我正在尝试构建 mongo-cxx-driver(最终),第一步是构建 mongo-c-driver(需要 libbson)。
我正在运行 Windows 10 并使用 Visual Studio 2015 作为我的编译器。我能够很好地运行 CMake 并构建 libbson,所有构建的项目都很好。现在我有bson-static-1.0.lib
内置mongo-c-driver/src/libbson/build/Debug/
和mongo-c-driver/src/libbson/build/Release/
. 这似乎一切都是正确的。
下一步是构建 mongo-c-driver。我运行 CMake 并尝试创建 Visual Studio 解决方案,但出现错误:
Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the system variable OPENSSL_ROOT_DIR (missing: OPENSSL_LIBRARIES OPENSSL_INCLUDE_DIR)
Searching for sasl/sasl.h
Not found (specify -DCMAKE_INCLUDE_PATH=C:/path/to/sasl/include for SASL support)
Searching for libsasl2
Not found (specify -DCMAKE_LIBRARY_PATH=C:/path/to/sasl/lib for SASL support)
Current version (from VERSION_CURRENT file): 1.3.5
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
BSON (ADVANCED)
linked by target "mongoc_shared" in directory C:/Users/sdf/Downloads/mongo-c-driver-1.3.5
linked by target "mongoc_static" in directory C:/Users/sdf/Downloads/mongo-c-driver-1.3.5
Configuring incomplete, errors occurred!
See also "C:/Users/sdf/Downloads/mongo-c-driver-1.3.5/build/CMakeFiles/CMakeOutput.log".
看起来变量BSON
没有设置为正确的值——它的值是BSON-NOTFOUND
现在。有谁知道正确的值是什么BSON
,以及它是否应该在编译过程中自动设置libbson
?