make error: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
解决办法:
重新编译gflags加上 【-DCMAKE_CXX_FLAGS=-fPIC】
git clone https://github.com/gflags/gflags.git
cd gflags
mkdir build && cd build
cmake .. -DGFLAGS_NAMESPACE=google -DCMAKE_CXX_FLAGS=-fPIC ..
make
sudo make install
make error:relocation R_X86_64_PC32 against symbol `stderr@@GLIBC_2.2.5'
https://www.inktea.eu.org/2022/8a8c.html