relocation R_X86_64_PC32 against symbol _ZTISt13runtime_error@@GLIBCXX_3.4 can not be used when making a shared object; recompile with -fPIC
As the error message says, you need to recompile with -fPIC
. Your current compiler command does not show the -fPIC
option:
g++ -I inc -I /usr/include/mono-2.0 -MMD -MF dep/Socket.d -std=c++17 -O3 -fno-stack-protector -fno-unroll-loops -fomit-frame-pointer -Wno-ignored-optimization-argument -c -o obj/Socket.o src/Socket.cpp
Same for -flto
by the way—this flag also has to be specified when compiling in order to be effective.
Compilation fails due to relocation error
I'm not sure that this is a proper solution, but as a workaround, you can replace the line
"C++ = g++"
with
"C++ = g++ -fPIC"
in the file Make-config
and then recompile.
Related Topics
Run Hydra (Mpiexec) Locally Gives Strange Ssh Error
Relative-To-Executable Path to Ld-Linux Dynamic Linker/Interpreter
Bash, Execute Command But Continue with Interactive Session
Understanding Linux Display Variable
Three Dots Directory Traversal with Mv
Problem in Restoring Floating Toolbar for Qmainwindow
Truncate Table via Command Line in Linux
How to Find Libstdc++.So.6: That Contain Glibcxx_3.4.19 for Rhel 6
How to Get The Union of Two Arrays in Bash
How to Kill a Whole Process Tree with Perl
How to Extract Value from JSON Contained in a Variable Using Jq in Bash
Remove Git-Annex Repository from File Tree
Posix: Pipe Syscall in Freebsd Vs Linux
Bash Script for Executing Commands on Multiple Server
How to Make Webdriver Testsuite Created in Windows Machine to Run in a Linux Box