简体   繁体   English

Mongo C ++客户端库看不到我的提升

[英]Mongo C++ Client Library Doesn't See My Boost

I have downloaded Boost version 1.51, built it, and put it to /usr/local/boost_1_51_0. 我已经下载了Boost版本1.51,构建它,并将其放到/ usr / local / boost_1_51_0。 I have also downloaded mongo-cxx-driver-v2.4. 我还下载了mongo-cxx-driver-v2.4。 Since there is no Makefile, I have to run scons, as this project is using the new python build environment. 由于没有Makefile,我必须运行scons,因为这个项目正在使用新的python构建环境。 When I run scons, it checks for boost_thread-mt and boost_thread, from which both return "no". 当我运行scons时,它检查boost_thread-mt和boost_thread,两者都返回“no”。 Obviously, it is not seeing that I have boost in the /usr/local directory. 显然,它没有看到我在/ usr / local目录中有提升。 Since I am a Make and not a scons person, how do I get the mongodb building process to see my version of boost? 既然我是Make而不是scons的人,我如何让mongodb构建过程看到我的版本的提升?

routerwc:~/mongo_proj/mongo-cxx-driver-nightly # scons --cpppath=/usr/local/boost_1_51_0/ --libpath=/usr/local/boost_1_51_0/stage/lib/
scons: Reading SConscript files ...
Checking for C++ library boost_thread-mt... no
Checking for C++ library boost_thread... no
routerwc:~/mongo_proj/mongo-cxx-driver-nightly # cat config.log 
file /root/mongo_proj/mongo-cxx-driver-nightly/SConstruct,line 70:
Configure(confdir = .sconf_temp)
scons: Configure: Checking for C++ library boost_thread-mt....sconf_temp/conftest_0.cpp <-
|
|
|
|int
|main() {
|  
|return 0;
|}
|
g++ -o .sconf_temp/conftest_0.o -c -O3 -pthread -D_SCONS -DMONGO_EXPOSE_MACROS -Ibuild -Ibuild/mongo .sconf_temp/conftest_0.cpp
g++ -o .sconf_temp/conftest_0 -Wl,--as-needed -Wl,-zdefs -pthread .sconf_temp/conftest_0.o -lboost_thread-mt
/usr/lib64/gcc/x86_64-suse-linux/4.3/../../../../x86_64-suse-linux/bin/ld: cannot find -lboost_thread-mt
collect2: ld returned 1 exit status
scons: Configure: no

scons: Configure: Checking for C++ library boost_thread....sconf_temp/conftest_1.cpp <-
|
|
|
|int
|main() {
|  
|return 0;
|}
|
g++ -o .sconf_temp/conftest_1.o -c -O3 -pthread -D_SCONS -DMONGO_EXPOSE_MACROS -Ibuild -Ibuild/mongo .sconf_temp/conftest_1.cpp
g++ -o .sconf_temp/conftest_1 -Wl,--as-needed -Wl,-zdefs -pthread .sconf_temp/conftest_1.o -lboost_thread
/usr/lib64/gcc/x86_64-suse-linux/4.3/../../../../x86_64-suse-linux/bin/ld: cannot find -lboost_thread
collect2: ld returned 1 exit status
scons: Configure: no

I was having the same problem, I download and extract boost in /usr/include/boost_1_57_0 then I run 我遇到了同样的问题,我在/ usr / include / boost_1_57_0下载并解压缩,然后运行

sudo apt-get install libboost-all-dev

Then in the directory i have the c++ drivers i run 然后在目录中我运行了c ++驱动程序

sudo scons --extrapath=/usr/include/boost_1_57_0

Im guessing you didnt install the libs, just ran ./b2 rather than ./b2 install 我猜你没有安装libs,只是运行./b2而不是./b2安装

Can you try the following? 你能试试以下吗?

scons --extrapath="/usr/local/boost_1_51_0/,/usr/local/boost_1_51_0/stage"

I solve this problem. 我解决了这个问题。

In the SCons, the order to test the boost libraries is wrong. 在SCons中,测试boost库的顺序是错误的。

Open the SConstruct file and change the following line: 打开SConstruct文件并更改以下行:

boostLibs = [ "regex", "thread", "system" ]

to

boostLibs = [ "system", "regex", "thread" ]

Cheers, 干杯,

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM