問題描述如下:
/usr/bin/ld: /usr/local/lib/libglog.a(libglog_la-logging.o): relocation R_X86_64_32S against `_ZTVN6google4base6LoggerE' can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/libglog.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
解決方法:
找到glog的源碼安裝包,然後按照下述方法重新編譯glog
1.進入glog檔案夾下
2.執行 ./configure CPPFLAGS="-I/usr/local/include -fPIC" LDFLAGS="-L/usr/local/lib"
3.make -j8
4.sudo make install
最後編譯自己的其他源碼包就不會有問題啦