Mongo c driver error when executing a build


I need help building mongo c driver.

I’m following all the steps from the installation link.

And I have successfully configured the build.

– Build files have been written to: /home/administrator/Projects/c or c++/mongo-c-driver/mongo-c-driver/cmake-build

But when i’m trying to executing the build, I’m always stuck with this error (whether it is executing a build from tarball or git).

[ 37%] Building C object src/libmongoc/CMakeFiles/mongoc_shared.dir/__/kms-message/src/sort.c.o
[ 38%] Linking C shared library
cc: error: or: No such file or directory
cc: error: c++/mongo-c-driver/mongo-c-driver/src/libmongoc/…/…/build/cmake/ No such file or directory
src/libmongoc/CMakeFiles/mongoc_shared.dir/build.make:3012: recipe for target ‘src/libmongoc/’ failed
make[2]: *** [src/libmongoc/] Error 1
CMakeFiles/Makefile2:1266: recipe for target ‘src/libmongoc/CMakeFiles/mongoc_shared.dir/all’ failed
make[1]: *** [src/libmongoc/CMakeFiles/mongoc_shared.dir/all] Error 2
Makefile:151: recipe for target ‘all’ failed
make: *** [all] Error 2

Please help.

Thanks and Regards,

@MONRUZ, the issue is that the build breaks when the source directory path includes a space. Rename your c or c++ directory to something like c_or_c++ and it should work. I am preparing a fix so that this will be fixed in the future.


Hi @Roberto_Sanchez,

Thanks, it works.

Best regards,