libboost无法正常工作(exercism cpp track)

时间:2019-04-10 16:51:23

标签: c++ ubuntu boost

我最近开始在锻炼网站上浏览cpp跟踪,并且从一开始我就得到了此错误列表,即使代码似乎可以很好地编译也是如此。 (我升级了boost,重新安装了CLI,但问题仍然存在)

[ 33%] Building CXX object CMakeFiles/scrabble-score.dir/scrabble_score_test.cpp.o
[ 66%] Building CXX object CMakeFiles/scrabble-score.dir/scrabble_score.cpp.o
[100%] Linking CXX executable scrabble-score
/usr/bin/ld: /usr/local/lib/libboost_unit_test_framework.a(test_tools.o): relocation R_X86_64_32S against `.bss' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: /usr/local/lib/libboost_unit_test_framework.a(test_tree.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: /usr/local/lib/libboost_unit_test_framework.a(unit_test_log.o): relocation R_X86_64_32S against symbol `_ZN5boost6detail15sp_counted_base7destroyEv' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: /usr/local/lib/libboost_unit_test_framework.a(unit_test_main.o): relocation R_X86_64_32 against symbol `_ZZN5boost4rtti11rtti_detail12rttid_holderIbE4instEvE6s_inst' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: /usr/local/lib/libboost_unit_test_framework.a(unit_test_parameters.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: /usr/local/lib/libboost_unit_test_framework.a(junit_log_formatter.o): relocation R_X86_64_32 against `.bss' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: /usr/local/lib/libboost_unit_test_framework.a(xml_log_formatter.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: /usr/local/lib/libboost_unit_test_framework.a(compiler_log_formatter.o): relocation R_X86_64_32S against symbol `_ZNK5boost9unit_test12lazy_ostreamclERSo' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: /usr/local/lib/libboost_unit_test_framework.a(decorator.o): relocation R_X86_64_32S against symbol `_ZN5boost6detail15sp_counted_base7destroyEv' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: /usr/local/lib/libboost_unit_test_framework.a(framework.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: /usr/local/lib/libboost_unit_test_framework.a(progress_monitor.o): relocation R_X86_64_32 against `.bss' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: /usr/local/lib/libboost_unit_test_framework.a(results_collector.o): relocation R_X86_64_32 against `.bss' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: /usr/local/lib/libboost_unit_test_framework.a(results_reporter.o): relocation R_X86_64_32S against `.rodata' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: /usr/local/lib/libboost_unit_test_framework.a(unit_test_monitor.o): relocation R_X86_64_32 against symbol `_ZZN5boost4rtti11rtti_detail12rttid_holderIbE4instEvE6s_inst' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: /usr/local/lib/libboost_unit_test_framework.a(xml_report_formatter.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: /usr/local/lib/libboost_unit_test_framework.a(debug.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: /usr/local/lib/libboost_unit_test_framework.a(execution_monitor.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: /usr/local/lib/libboost_unit_test_framework.a(plain_report_formatter.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: final link failed: Nonrepresentable section on output
collect2: error: ld returned 1 exit status
CMakeFiles/scrabble-score.dir/build.make:122: recipe for target 'scrabble-score' failed
make[2]: *** [scrabble-score] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/scrabble-score.dir/all' failed
make[1]: *** [CMakeFiles/scrabble-score.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

0 个答案:

没有答案