Uploaded image for project: 'C++ Driver'
  1. C++ Driver
  2. CXX-1605

'mongocxx::cursor' could not be resolved

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major - P3
    • Resolution: Duplicate
    • 3.3.0
    • None
    • BSON, Release
    • None
    • ubuntu 16.04
      Eclipse IDE for C/C++ Developers
      c++11

    Description

      Hi.
      This code works(i.e. it run)

       

      mongocxx::instance instance{}; // This should be done only once.
       mongocxx::uri uri("mongodb://192.168.1.1:27017");
       mongocxx::client client(uri);
       mongocxx::database db = client["test"];
       mongocxx::collection coll = db["counters"];
      mongocxx::cursor cursor = coll.find({});
      for(auto doc : cursor) {
       std::cout << bsoncxx::to_json(doc) << "\n";
       }
      

      But at compilation errors:

      Method 'find' could not be resolved
      'mongocxx::cursor' could not be resolved
       
      How to make that there were no errors?

      -I/usr/local/include/libbson-1.0
      -I/usr/local/include/libmongoc-1.0
      -I/usr/local/include/mongocxx/v_noabi
      -I/usr/local/include/bsoncxx/v_noabi
      -lbsoncxx -lmongocxx
      -L/usr/local/lib -Wl,-rpath=/usr/local/lib
      

       

      Attachments

        Issue Links

          Activity

            People

              jesse@mongodb.com A. Jesse Jiryu Davis
              Black333 Black [X]
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: