Relocation R_X86_64_Pc32 Against Symbol _Ztist13Runtime_Error@@Glibcxx_3.4 Can Not Be Used When Making a Shared Object; Recompile with -Fpic

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



Leave a reply



Submit