Hi,
I am trying to build the C++ driver following the instructions provided here: https://github.com/mongodb/mongo-cxx-driver/wiki/Quickstart-Guide-%28New-Driver%29
Unfortunately I am experiencing a few issues.
The information of my setup is as follows:
- The version of the driver you are trying to build (branch or tag).
- Mongo C++ Driver
- Host OS, version, and architecture.
- Windows 7 Pro 64bit
- C++ Compiler and version.
- MSVC 2015 Community Update 2 (version 14.0.25123.00)
- Cmake version.
- 3.5.2
According to your new driver guide there doesn't seem to be any need for the PKG CONFIG tool and instructions on how the installation could be done in a Windows environment.
I successfully built the latest MongoDB C driver version from github, and I tried to use a similar approach for the c++ driver.
Can you please provide instructions for building in a windows environment and whether the PKG Config tool is needed or not?
Also, after a few efforts I saw in the CMakeLists.txt that for the case of Visual Studio there is a version condition:
"...elseif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "19.0.23506")
message(FATAL_ERROR "Insufficient Microsoft Visual C++ version - MSVC 2015 Update 1+ required") ... "
while the current version of VS2015 Community Update 2 is 14.0.25123.00.
On Tue, May 24, 2016 at 5:36 AM, Apostolos T <apts...@gmail.com> wrote:Hi,
I am trying to build the C++ driver following the instructions provided here: https://github.com/mongodb/mongo-cxx-driver/wiki/Quickstart-Guide-%28New-Driver%29
Unfortunately I am experiencing a few issues.
The information of my setup is as follows:
- The version of the driver you are trying to build (branch or tag).
- Mongo C++ Driver
- Host OS, version, and architecture.
- Windows 7 Pro 64bit
- C++ Compiler and version.
- MSVC 2015 Community Update 2 (version 14.0.25123.00)
- Cmake version.
- 3.5.2
Thanks for providing this, it is very helpful.According to your new driver guide there doesn't seem to be any need for the PKG CONFIG tool and instructions on how the installation could be done in a Windows environment.If you don't have pkgconfig on Windows (and I think it is pretty unusual to have it), you will need to explicitly tell the C++11 driver CMake where to find libbson and libmongoc by setting the LIBBSON_DIR and LIBMONGOC_DIR variables explicitly.It would be better if the C driver installed CMake Find modules, but it currently does not (see https://jira.mongodb.org/browse/CDRIVER-1058)I successfully built the latest MongoDB C driver version from github, and I tried to use a similar approach for the c++ driver.
Can you please provide instructions for building in a windows environment and whether the PKG Config tool is needed or not?Per the above, you need to set LIBBSON_DIR and LIBMONGOC_DIR. Please have a look at our AppVeyor configuration for examples:
Also, after a few efforts I saw in the CMakeLists.txt that for the case of Visual Studio there is a version condition:
"...elseif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "19.0.23506")
message(FATAL_ERROR "Insufficient Microsoft Visual C++ version - MSVC 2015 Update 1+ required") ... "
while the current version of VS2015 Community Update 2 is 14.0.25123.00.This is checking the vesrion of Visual C++, not Visual Studio:I'm reasonably sure that this check is correct? Is it actually issuing the fatal error? Do you have more than one version of Visual C++ installed on this system? How are you specifying which one to use? Are you running inside the configured terminal for one of the VC installs?
Thanks,Andrew
By running the following command ( according to the guidelines you provided) I was able to build the mongo-cxx-driver projects:
- ...\mongo-cxx-driver>cmake.exe -G "Visual Studio 14 2015 Win64" "-DLIBBSON_DIR=C:\mongo-c-driver" "-DLIBMONGOC_DIR=C:\mongo-c-driver" "-DBOOST_ROOT=PATH\BOOST_1.56" "-DBOOST_INCLUDEDIR=PATH\BOOST_1.56" "-DCMAKE_BUILD_TYPE = Release" "-DCMAKE_INSTALL_PREFIX = c:\mongo-cxx-driver"
and then I ran ALL_BUILD.vcxproj & INSTALL.vcxproj through the VS2015.
Finally, another think that should be mentioned to the Wiki (regarding the new driver) is the need for the BOOST library and specifically above v1.56.