gpt4 book ai didi

c++ - 构建 mongo c++ 驱动程序

转载 作者:行者123 更新时间:2023-11-30 05:08:07 24 4
gpt4 key购买 nike

在 CentOs 7 下,我从 here 克隆了驱动程序.

当我去构建它时,我得到一个关于 libbson 的错误。然而 libbson 既在 LD_LIBRARY_PATH 上又在 PATH

[idf@njserver build]$ echo $LD_LIBRARY_PATH
/usr/lib64:/usr/local/lib64:/usr/local/lib:/lib64:/usr/lib64:/usr/local/lib64:/usr/local/lib:/lib64:/opt/rh/devtoolset-6/root/usr/lib64:/opt/rh/devtoolset-6/root/usr/lib:/usr/lib64:/usr/local/lib64:/usr/local/lib:/lib64:
[idf@njserver build]$

路径

[idf@njserver build]$ echo $PATH
/usr/lib64:/opt/rh/devtoolset-6/root/usr/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/home/idf/.local/bin:/home/idf/bin
[idf@njserver build]$

证明libbson/usr/lib64

[idf@njserver build]$ ls /usr/lib64/libbson*
/usr/lib64/libbson-1.0 /usr/lib64/libbson-1.0.so /usr/lib64/libbson-1.0.so.0 /usr/lib64/libbson-1.0.so.0.0.0
[idf@njserver build]$

尝试构建

[idf@njserver build]$ cmake ..
-- The CXX compiler identification is GNU 6.3.1
-- Check for working CXX compiler: /opt/rh/devtoolset-6/root/usr/bin/c++
-- Check for working CXX compiler: /opt/rh/devtoolset-6/root/usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- No build type selected, default is Release
-- The C compiler identification is GNU 6.3.1
-- Check for working C compiler: /opt/rh/devtoolset-6/root/usr/bin/cc
-- Check for working C compiler: /opt/rh/devtoolset-6/root/usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
CMake Error at src/bsoncxx/CMakeLists.txt:70 (find_package):
By not providing "Findlibbson-1.0.cmake" in CMAKE_MODULE_PATH this project
has asked CMake to find a package configuration file provided by
"libbson-1.0", but CMake did not find one.

Could not find a package configuration file provided by "libbson-1.0"
(requested version 1.9.0) with any of the following names:

libbson-1.0Config.cmake
libbson-1.0-config.cmake

Add the installation prefix of "libbson-1.0" to CMAKE_PREFIX_PATH or set
"libbson-1.0_DIR" to a directory containing one of the above files. If
"libbson-1.0" provides a separate development package or SDK, be sure it
has been installed.


-- Configuring incomplete, errors occurred!
See also "/home/idf/builds/mongo-cxx-driver/build/CMakeFiles/CMakeOutput.log".
[idf@njserver build]$

不确定为什么会这样?

最佳答案

我通过手动(没有 yum、apt 等)libbson、libmongo-c 驱动程序和最后的 libmongo-cpp 驱动程序编译库解决了这个问题

关于c++ - 构建 mongo c++ 驱动程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47007952/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com