I did downloaded/compiled boost and installed under the folder /usr/local/boost_clang/
now, when I build the code, I get the following error:
1 2 3 4 5 6 7 8 9 10 11 12 13
/usr/bin/ld: /usr/local/boost_clang/lib/libboost_iostreams.a(file_descriptor.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: /usr/local/boost_clang/lib/libboost_serialization.a(basic_oarchive.o): relocation R_X86_64_32S against symbol `_ZTVN5boost7archive6detail14basic_oarchiveE' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: /usr/local/boost_clang/lib/libboost_serialization.a(basic_oserializer.o): relocation R_X86_64_32S against symbol `_ZTVN5boost7archive6detail17basic_oserializerE' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: /usr/local/boost_clang/lib/libboost_serialization.a(basic_text_oprimitive.o): relocation R_X86_64_32S against hidden symbol `_ZTVN5boost7archive12codecvt_nullIcEE' can not be used when making a PIE object
/usr/bin/ld: /usr/local/boost_clang/lib/libboost_serialization.a(extended_type_info.o): relocation R_X86_64_32 against hidden symbol `_ZZN5boost13serialization9singletonISt8multisetIPKNS0_18extended_type_infoENS0_6detail11key_compareESaIS5_EEE12get_instanceEvE1t' can not be used when making a PIE object
/usr/bin/ld: /usr/local/boost_clang/lib/libboost_serialization.a(extended_type_info_typeid.o): relocation R_X86_64_32S against symbol `_ZTVN5boost13serialization13typeid_system27extended_type_info_typeid_0E' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: /usr/local/boost_clang/lib/libboost_serialization.a(text_oarchive.o): relocation R_X86_64_32 against hidden symbol `_ZZN5boost13serialization9singletonINS_7archive6detail12extra_detail3mapINS2_13text_oarchiveEEEE12get_instanceEvE1t' can not be used when making a PIE object
/usr/bin/ld: /usr/local/boost_clang/lib/libboost_serialization.a(archive_exception.o): relocation R_X86_64_32S against `.rodata' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: /usr/local/boost_clang/lib/libboost_serialization.a(basic_archive.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a PIE object; recompile with -fPIE
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/MTmgen.dir/build.make:89: MTmgen] Error 1
make[1]: *** [CMakeFiles/Makefile2:76: CMakeFiles/MTmgen.dir/all] Error 2
make: *** [Makefile:84: all] Error 2
I think the solution will be to recompile the boost static libraries with the -lPIE flag. Is this correct?
Also, what is this error meaning? what is not working here?
hello coder, thank for the short answer.
I did not notice the double link to filesystem, and thanks to point me the typo.
Still some context would be useful here, what is failing without the -fPIE flag? Why can't I simply point my compiler to the archives (which is from my understanding what the .a library are) and expect it links the boost code into my executable?
It is probably a version conflict. Either the compiler or the target system has some mismatch. In both cases it most likely means that you have some dated libs and you may even don't need this flag when you compile the libs on your system.
By the way: The most recent version of boost is now 1.74