You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/usr/bin/ld: //usr/local/lib/libgflags.a(gflags.cc.o): relocation R_X86_64_32 against symbol __pthread_key_create@@GLIBC_2.2.5' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: //usr/local/lib/libgflags.a(gflags_reporting.cc.o): relocation R_X86_64_32 against .rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: //usr/local/lib/libgflags.a(gflags_completions.cc.o): relocation R_X86_64_32S against symbol `_ZNSs4_Rep20_S_empty_rep_storageE@@GLIBCXX_3.4' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Nonrepresentable section on output
collect2: error: ld returned 1 exit status
Makefile:1052: recipe for target 'libglog.la' failed
make: *** [libglog.la] Error 1
how to solve the problem,thanks
The text was updated successfully, but these errors were encountered:
shijiejie
changed the title
make glog
(gflags_reporting.cc.o): relocation R_X86_64_32 against.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
Mar 30, 2017
i meet the same problem. After i tried on another machine, i find the reason why it generates. when i install gflags from the source code, i run ccmake .. , then there are some options for building. you should change the BUILD_SHARED_LIBS to ON,so it can be compiled to .so file。When you compile the glog, it will link to the libgflags, and the libgflags should be dynamic lib so that it can be linked.
The answer from @kiukotsu does resolve the specific issue, but is there a reason position independent code isn't set for static builds, or why static building of the code is default? Is the only "appropriate" or "official" solution to build with the -DBUILD_SHARED_LIBS=True?
/usr/bin/ld: //usr/local/lib/libgflags.a(gflags.cc.o): relocation R_X86_64_32 against symbol
__pthread_key_create@@GLIBC_2.2.5' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: //usr/local/lib/libgflags.a(gflags_reporting.cc.o): relocation R_X86_64_32 against
.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC/usr/bin/ld: //usr/local/lib/libgflags.a(gflags_completions.cc.o): relocation R_X86_64_32S against symbol `_ZNSs4_Rep20_S_empty_rep_storageE@@GLIBCXX_3.4' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Nonrepresentable section on output
collect2: error: ld returned 1 exit status
Makefile:1052: recipe for target 'libglog.la' failed
make: *** [libglog.la] Error 1
how to solve the problem,thanks
The text was updated successfully, but these errors were encountered: