c++mongodbqt-creatormongodb-c

Mongo dB c++ driver installation issues in Windows


I was installing mongo DB C++ driver on windows using this http://mongocxx.org/ . My aim is to write mongo dB code on Qt Creator using C++. so I am a beginner so the steps given in above link not in details . if anybody did this before please describe in simple manner...

edited: i was trying to build the driver file using mingw64 shown in the linkhttp://mongoc.org/libmongoc/current/installing.html thi shows error .

LD-RD2@LD-RD2 MINGW64 ~/mongo-c-driver-1.18.0/cmake-build
# cmake -DENABLE_AUTOMATIC_INIT_AND_CLEANUP=OFF ..
CMake Error: CMake was unable to find a build program corresponding to "Ninja".  CMAKE_MAKE_PROGRAM is not set.  You probably need to select a different build tool.
CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!
See also "C:/Users/LD-RD2/AppData/Roaming/SPB_Data/mongo-c-driver-1.18.0/cmake-build/CMakeFiles/CMakeOutput.log".

Updated: Error

LD-RD2@LD-RD2 MINGW64 ~/mongo-cxx-driver-r3.6.5/build2
# ‘C:\Program Files\CMake\bin\cmake.exe’ … \
-G "MSYS Makefiles"           \
-DCMAKE_PREFIX_PATH=C:\Program Files (x86)\mongo-c-driver       \
-DCMAKE_INSTALL_PREFIX=C:\mongo-cxx-driver ..
-bash: syntax error near unexpected token `('
-bash: -DCMAKE_INSTALL_PREFIX=C:mongo-cxx-driver: command not found

LD-RD2@LD-RD2 MINGW64 ~/mongo-cxx-driver-r3.6.5/build2
# cmake -G "MSYS Makefiles"           \
-DCMAKE_PREFIX_PATH=C:\Program Files (x86)\mongo-c-driver       \
-DCMAKE_INSTALL_PREFIX=C:\mongo-cxx-driver ..
-bash: syntax error near unexpected token `('
-bash: -DCMAKE_INSTALL_PREFIX=C:mongo-cxx-driver: command not found

Solution

  • You can tell CMake to generate standard makefiles instead by doing:

    cmake -G "Unix Makefiles" -DENABLE_AUTOMATIC_INIT_AND_CLEANUP=OFF ..
    

    Alternatively, you can just install Ninja (and make it available on your $PATH), which is the better choice for a CMake target.

    Check cmake --help to see which generators are available, you may need to use the "MSYS Makefiles" generator instead.