Can not find header in mongocxx on OS:windows

i m currently trying to install the mongocxx driver on my windows os. I followed the official guide except I git clone instead of getting from the tarball. there were no fatal errors during the build. However, I was unable to link to the header files.
For example, when I run: gcc -lmongoc-1.0 -lbsoncxx -lmongocxx test.cpp
it gave me a fatal error: mongocxx/client.hpp:No such file or directory
1 | #include <mongocxx/client.hpp>.
It would seem like they could not find the client.hpp file in the mongocxx file.

Just to be clear, the compiler was not be able to find any header files.
Thank you for the help!

@Xiaoyan_Ge Have you confirmed that your compiler default search patch includes the installed location of your installed MongoDB C++ driver build? You do not mention if this was done in an environment like Cygwin that would support Unix-like default directories for the compiler. You also do not mention if you modified the default target directory for the C++ driver installation. By default the build will install into a sub-directory of the directory from which you execute the build, rather than some place that could require root/administrative permissions (like /usr/local). If you could provide the complete sequence of commands you used to build the C++ driver with all the options you used, along with the complete terminal output, then perhaps we can help with better precision.

1 Like