Test compilation fails on Arch with static Boost test library
bchretien opened this issue · comments
The error:
/usr/bin/ld: /usr/lib64/libboost_unit_test_framework.a(framework.o): relocation R_X86_64_32 against `.bss' can not be used when making a shared object; recompile with -fPIC
/usr/lib64/libboost_unit_test_framework.a: error adding symbols: Bad value
I would advise to use the shared libraries, unless there's a good reason not to. You just need to remove set(Boost_USE_STATIC_LIBS ON)
and add ADD_DEFINITIONS(-DBOOST_TEST_DYN_LINK)
.