如何正确链接/构建Boost库?

时间:2019-04-11 18:51:42

标签: boost makefile centos7 intel boost-system

伙计们,几乎对这个话题发疯了。

我要安装一个大型软件,它的要求之一是Boost库。 我使用intel工具集构建它,但是总是在尝试制作软件时出现此错误:

./libsrnd/.libs/libsrnd.so: undefined reference to `boost::serialization::singleton_module::is_locked()'
/home/igor/bie/Galphat/.libs/libGalphat.so: undefined reference to `boost::system::system_category()'
/home/igor/bie/Galphat/.libs/libGalphat.so: undefined reference to `boost::system::generic_category()'
make[3]: *** [bie_server_cli] Error 1
make[3]: *** Waiting for unfinished jobs....
../libsrnd/.libs/libsrnd.so: undefined reference to `boost::serialization::singleton_module::is_locked()'
/home/igor/bie/Galphat/.libs/libGalphat.so: undefined reference to `boost::system::system_category()'
/home/igor/bie/Galphat/.libs/libGalphat.so: undefined reference to `boost::system::generic_category()'
make[3]: *** [bie_server] Error 1
cli.o: In function `__sti__$E':
cli.cc:(.text+0xa3d2): undefined reference to `boost::system::generic_category()'
cli.cc:(.text+0xa3de): undefined reference to `boost::system::generic_category()'
cli.cc:(.text+0xa3ea): undefined reference to `boost::system::system_category()'
../libVector/.libs/libvector.so: undefined reference to `boost::serialization::singleton_module::is_locked()'

我的boost库是使用以下命令构建的:

./bootstrap.sh
./b2 toolset=intel address-model=64 cxxflags="-std=c++11 fPIC" --layout=versioned link=static variant=debug,release

我可以通过以下方式构建软件:

./configure --prefix=/usr/local/galphat --with-boost-libdir=/home/igor/boost_1_69_0/stage/lib

在增强测试上似乎还不错:

checking for boostlib >= 1.56.0... yes
checking whether the Boost::Filesystem library is available... yes
checking for exit in -lboost_filesystem-il-mt-x64-1_69... yes
configure: WARNING: BOOST_CPPFLAGS -I/usr/include
checking whether the Boost::Serialization library is available... yes
checking for exit in -lboost_serialization-il-mt-d-x64-1_69... yes
checking whether the Boost::Regex library is available... yes
checking for exit in -lboost_regex-il-mt-d-x64-1_69... yes
checking whether the Boost::Program_Options library is available... yes
checking for exit in -lboost_program_options-il-mt-d-x64-1_69... yes
checking whether the Boost::System library is available... yes
checking for exit in -lboost_system-il-mt-x64-1_69... yes

OS是CentOS Linux版本7.4.1708(核心)

有人可以指出进一步尝试的方向吗?

1 个答案:

答案 0 :(得分:0)

由于没有人提供任何反馈,因此我正在尝试进一步测试。 似乎与较新的Boost版本的软件兼容性存在问题。 我通过1.63-1.69生成了所有版本,只有1.61可用,而其他所有版本几乎都给出了相同的错误。

相关问题