mercredi 14 septembre 2016

make mongo-cxx-driver cannot find includes

I've been trying to compile the mongo-cxx-driver for C++11 on OSX 10.10, but I have some trouble with it. Both libbson and mongo-c-driver were built and installed successfully, the libraries to to /usr/local/lib, and the headers to /usr/local/include/libbson-1.0 and /usr/local/include/libmongoc-1.0 respectively. I ran cmake successfully from the mongo-cxx-driver/build directory:

~/code/cpp/mongo-cxx-driver/build  ((r3.0.1)) $> cmake -DLIBBSON_DIR=/usr/local/include/libbson-1.0 -DLIBMONGOC_DIR=/usr/local/include/libmongoc-1.0 -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local ..
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/user/code/cpp/mongo-cxx-driver

when I run make form the mongo-cxx-driver directory, I get the following error:

...
[  4%] Building CXX object src/bsoncxx/CMakeFiles/http://ift.tt/2cmYgf6
/Users/user/code/cpp/mongo-cxx-driver/src/bsoncxx/array/view.cpp:21:10: fatal error: 'bson.h' file not
  found
#include <bson.h>
         ^
1 error generated.

Apparently the compiler fails to find those includes ... but why? Isn't that what LIBBSON_DIR and LIBMONGOC_DIR were set for in the cmake command line?

Aucun commentaire:

Enregistrer un commentaire