cpp: recipe for target 'all' failed
- Dominant language
- No language data
- Stars
- 3
- Forks
- 3
- PR merge metrics
- No merged PRs in 30d
Description
I started with cpp and although my code seems to work fine, I get this list of errors (in all of my exercises). Is there any way to fix it?
[ 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
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with the CMake-generated CMakeFiles/scrabble-score.dir/build.make and the linker errors involving /usr/local/lib/libboost_unit_test_framework.a. Reproduce the `make` failure and trace the PIE/static-library mismatch; done means the `all` target links successfully without the reported relocation errors.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cmake, cpp
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100