Recompile with-fpic/usr/local/lib/libboost_python.a:could not read Symbols:bad value

Source: Internet
Author: User
Tags truncated

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.