O
O
Ockonal2011-03-11 23:10:55
Python
Ockonal, 2011-03-11 23:10:55

CMake linker...?

Hello, linking boost.python via the cmake build system.

set(Boost_USE_STATIC_LIBS OFF)<br/>
set(Boost_USE_MULTITHREADED ON)<br/>
set(Boost_USE_STATIC_RUNTIME OFF)<br/>
<br/>
find_package(Boost COMPONENTS filesystem system date_time python REQUIRED)<br/>
<br/>
add_definitions(-Wall -g -msse2 -fPIC)

Main parameters of the project.
Just when the build crashes:
/usr/bin/ld: libboost_python.a(from_python.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a shared object; recompile with -fPIC<br/>
libboost_python.a: could not read symbols: Bad value

I looked at the linker arguments that are used (via make VERBOSE=1):
/usr/bin/c++ -fPIC -g -shared -Wl,-soname,libScript.so -o ../../lib/libScript.so CMakeFiles/LogManagerWrapper.cpp.o -Wl,-Bstatic -lboost_filesystem -lboost_system -lboost_date_time -lboost_python -Wl,-Bdynamic -lpython2.7

Removed -Wl , -Bstatic at random , it worked. What could it be?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question