make报错:relocation R_X86_64_PC32 against symbol `stderr@@GLIBC_2.2.5'
make时链接gflags时报错,错误提示如下:
relocation R_X86_64_PC32 against symbol `stderr@@GLIBC_2.2.5'
can not be used when making a shared object;
recompile with -fPIC
问题起因与解决
链接库中使用了libglog.so与libgflags.a,编译时动态库与静态库不能混用。
重新编译了gflags生成动态库libgflags.so,然后加入cmake的target_link_libraries中,问题解决。