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

'mongocxx::cursor' could not be resolved

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Duplicate
    • Affects Version/s: 3.3.0
    • Fix Version/s: None
    • Component/s: BSON, Release
    • Labels:
      None
    • Environment:
      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

              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: