1

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
VIVEK A
  • 27
  • 6

1 Answers1

1

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.

Botje
  • 26,269
  • 3
  • 31
  • 41
  • thanks for valuable info. its solved the step1. mongo dB c driver installed successfully. Next i am trying to install Mongodb C++ driver (according the procedure given above links). error occured again updated in above . – VIVEK A Aug 12 '21 at 10:44
  • You cannot use windows-style paths with MinGW. Convert them to unix style paths (ask the `cygpath` tool if you don't know.) – Botje Aug 12 '21 at 11:02
  • 1
    i converted into unix style but it still makes problem due to the space in path , so i used quotes ,still not solved . `-DLIBMONGOC_DIR=”/c/Program Files (x86)/mongo-c-driver/”` . So i moved the folder(mongo-c-driver) and now `-DLIBMONGOC_DIR=”/c/mongo-c-driver/”` errors solved . – VIVEK A Aug 13 '21 at 06:51