Mongo c driver error when executing a build

Hi,

I need help building mongo c driver.

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

http://mongoc.org/libmongoc/current/installing.html

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 libmongoc-1.0.so
cc: error: or: No such file or directory
cc: error: c++/mongo-c-driver/mongo-c-driver/src/libmongoc/…/…/build/cmake/libmongoc-hidden-symbols.map: No such file or directory
src/libmongoc/CMakeFiles/mongoc_shared.dir/build.make:3012: recipe for target ‘src/libmongoc/libmongoc-1.0.so.0.0.0’ failed
make[2]: *** [src/libmongoc/libmongoc-1.0.so.0.0.0] 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,
Monthy

@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.

1 Like

Hi @Roberto_Sanchez,

Thanks, it works.

Best regards,
Monthy