In the use of the Boost library encountered a number of setbacks, this document is convenient for everyone to refer to:
1. libboost_python.so:file not recognized:file truncated
Let's take a look at the libboost_python.so file, it does exist:
So file truncated is mostly due to corrupted files, so we reload the boost (the installation command can be changed slightly with this) to solve the problem.
2. /usr/bin/ld:/usr/local/lib/libboost_python.a (LIST.O): Relocation r_x86_64_32 against '. rodata.str1.1 ' Can not be used when making a shared object; Recompile with-fpic
/usr/local/lib/libboost_python.a:could not read Symbols:bad value
What the hell is this?
Google to the result said in the compiler command to add parameters-fpic on it, but I makefile there is-fpic ah, this problem actually in Libboost_python.a compile. The reason is that the Boost compiler tool Bjam does not use the-FPIC option when compiling the boost static library, so that the compiled static library does not have the ability to reposition. This makes it almost entirely useless to boost the compiled static libraries on 64-bit machines. and the Bjam tool does not provide the ability to customize compilation parameters.
Solution:
Download static libraries compiled with boost and Python, replacing Boost_python.a (in the installation directory, such as/usr/local/lib)
Reference:
problem resolution for static library compilation without-fpic option in boost
Recompile with-fpic/usr/local/lib/libboost_python.a:could not read Symbols:bad value