c++ - libboost_*.so : file not recognized: File truncated When dynamically linking using libtool and automake to generate makefile

标签 c++ boost dynamic-linking dynamic-library

我收到以下错误:

../../../external/boost-1.55.0-x86_64-linux-gcc-4.8.2/lib/libboost_system.so: file not recognized: File truncated

如果我交换 boost_filesystem 和 boost_system 的顺序,我会收到以下错误:

../../../external/boost-1.55.0-x86_64-linux-gcc-4.8.2/lib/libboost_filesystem.so: file not recognized: File truncated

据我所知,Boost 构建正确。构建期间没有错误。进行链接的 makefile 如下:

libtool: link: g++ -g -O2 -pthread -Wl,-rpath=../../../external/boost-1.55.0-x86_64-linux-gcc-4.8.2/lib -o xml_wrapper_tester xml_wrapper_tester-runner.o  - L../../../external/boost-1.55.0-x86_64-linux-gcc-4.8.2/lib -lboost_wserialization -lboost_timer -lboost_date_time -lboost_iostreams -lboost_chrono -lboost_atomic -lboost_serialization -lboost_locale -lboost_log -lboost_thread -lboost_regex -lboost_log_setup -lboost_system -lboost_filesystem ../xml_wrapper/.libs/libxml_wrapper.a-pthread
../../../external/boost-1.55.0-x86_64-linux-gcc-4.8.2/lib/libboost_system.so: file not recognized: File truncated
collect2: error: ld returned 1 exit status
make[2]: *** [xml_wrapper_tester] Error 1
make[2]: Leaving directory /home/mehoggan/Devel/RuleSimulator/src/xml/xml_wrapper_tester'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/mehoggan/Devel/RuleSimulator/src/xml'
make: *** [all] Error 2

最佳答案

听起来您的 libboost* 文件已损坏。

问:它们是你自己 build 的吗?如果是这样,我建议“清理”(或从您的构建根目录中“rm -rf”),然后从头开始重建。

这样做时请仔细检查是否存在任何构建错误。

我会非常仔细地遵循这些说明:

http://www.boost.org/doc/libs/1_55_0/more/getting_started/unix-variants.html

'希望对你有帮助

关于c++ - libboost_*.so : file not recognized: File truncated When dynamically linking using libtool and automake to generate makefile,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23508010/

相关文章:

c++ - 在库中使用全局变量

linux - 每个函数加载的 glibc 基地址不同

c++ - 在if语句C++中意外中断

c++ - 为什么这个微小的 RSA 实现会给出错误的结果?

c++ - QScriptEngine评估数字c++的平方或立方

c - 使用一些相同的符号链接(symbolic link)两个共享库

c++ - 从 FlasK(又名 Crossbridge)访问 Win32 API

c++ - Boost 可选,带有 Boost Thread 编译问题

c++ - 在PBGL中使用 `make_distributed_property_map`

c++ - 为什么 boost::optional 对于继承虚函数的类会失败