Reputation: 45
I'm having some trouble setting up the MongoDb C++ driver.
I installed CMake via the exe. Then pkg-config via MSYS2.
Then I proceeded with the tutorial for setting up the MongoDB C++ driver. And I got stuck at 'Connect to MongoDB'.
https://www.mongodb.com/docs/languages/cpp/cpp-driver/current/get-started/connect-to-mongodb/
I got stuck at step 4 when running the following commands.
c++ --std=c++17 quickstart.cpp $(pkg-config --cflags --libs libmongocxx) -o ./app.out
./app.out
It couldn't detect pkg-config, so I ran export PATH="/c/msys64/usr/bin:$PATH. For context, I'm using Gitbash.
Then I ran the command on step 4 again, and I keep getting this error:
Package libmongocxx was not found in the pkg-config search path.
Perhaps you should add the directory containing `libmongocxx.pc'
to the PKG_CONFIG_PATH environment variable
Package 'libmongocxx' not found
Now, I edited the path following instructions from ChatGPT. But I think the main problem is libmongocxx.pc
does not exist. Instead there's a file called libmongocxx.pc.in
. I'm told that this is something CMake makes.
Any help is appreciated.
Upvotes: 0
Views: 29