6

我已经下载了 Boost 1.51 版,构建了它,并将它放到 /usr/local/boost_1_51_0。我还下载了 mongo-cxx-driver-v2.4。由于没有 Makefile,我必须运行 scons,因为这个项目使用的是新的 python 构建环境。当我运行 scons 时,它会检查 boost_thread-mt 和 boost_thread,两者都返回“no”。显然,在 /usr/local 目录中没有看到我有提升。由于我是 Make 而不是 scons 人,我如何让 mongodb 构建过程看到我的 boost 版本?

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
4

3 回答 3

1

我遇到了同样的问题,我在 /usr/include/boost_1_57_0 中下载并提取 boost 然后我运行

sudo apt-get install libboost-all-dev

然后在目录中我有我运行的 c++ 驱动程序

sudo scons --extrapath=/usr/include/boost_1_57_0
于 2015-02-13T02:34:57.210 回答
0

我猜你没有安装库,只是运行 ./b2 而不是 ./b2 install

你可以试试下面的吗?

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

于 2013-05-29T05:47:10.913 回答
0

我解决了这个问题。

在 SCons 中,测试 boost 库的顺序是错误的。

打开 SConstruct 文件并更改以下行:

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

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

干杯,

于 2015-07-17T19:35:56.350 回答