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

StackOverflow https://stackoverflow.com/questions/23508010

Question

I am getting the following error:

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

If I swap the order of boost_filesystem and boost_system I get the following error:

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

Boost built correctly to my knowledge. There were no errors during the build. The makefile that is doing the linking is as follows:

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
Was it helpful?

Solution

It sounds like your libboost* files are corrupt.

Q: Did you build them yourself? If so, I'd suggest "make clean" (or "rm -rf" from your build root), and rebuild from scratch.

Check carefully for any build errors when you do so.

I would very carefully follow these instructions:

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

'Hope that helps

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top