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

'mongocxx::cursor' could not be resolved

    • Type: Icon: Bug Bug
    • Resolution: Works as Designed
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 3.3.0
    • Component/s: BSON, Release
    • None
    • Environment:
      ubuntu 16.04
      Eclipse IDE for C/C++ Developers
      c++11

      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
      

       

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

              Created:
              Updated:
              Resolved: