Implement MongoDB with Qt: mongocxx
-
Hi,
I get file not found errors on these lines:#include <bsoncxx/json.hpp> #include <mongocxx/client.hpp> #include <mongocxx/stdx.hpp> #include <mongocxx/uri.hpp> #include <mongocxx/instance.hpp>
Thanks
-
@Arush-Gupta
This is not my area, so may not be correct, but while you wait for an expert to comment....-I/usr/local/include/mongocxx/v_noabi \ -I/usr/local/include/bsoncxx/v_noabi
This tells compiler to look in those two directories for files. But your includes read
#include <mongocxx/instance.hpp>
etc. So to find those paths it needs (presumably) to look down from/usr/local/include
to find/usr/local/include/mongocxx/instance.hpp
(assuming that is correct). In which case, if compiler does not already look automatically in/usr/local/include
(I don't know if it does) you would need-I/usr/local/include
? -
Hi,
Thanks for the response
But that does not fix it :(
.pro:INCLUDEPATH += \ -I/usr/local/include/ LIBS += \ -L/usr/local/lib \ -lmongocxx \ -lbsoncxx
Thanks
-
Where are the files you include located on your hard drive exactly ?
-
Hi,
/usr/local/include/mongocxx/v_noabi/ contains folder mongocxx and /usr/local/include/bsoncxx/v_noabi/ contains folder bsoncxx.
Thanks -
I see your issue now. Go back to the original paths you were using but remove the -I before the path, they are unneeded with the INCLUDEPATH variable.
-
Hi,
Thanks it worked, I was able to import it, but another issue poped up:error: 'bsoncxx::v_noabi::builder::stream' has not been declared 20 | using bsoncxx::builder::stream::close_array; | ^~~~~~
But I can see folder stream inside builder inside bsoncxx.
In the error I see that it want's to import bsoncxx::v_noabi::builder::stream but I want it to use bsoncxx::v_noabi::bsoncxx::builder::stream
Thanks -
That I do not know.
Can you provide a minimal example that triggers this error ?
-
Sorry for the late response,
I solved the issue by reinstalling the packages
Thanks for the help.