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
- is duplicated by
-
CXX-1605 'mongocxx::cursor' could not be resolved
- Closed