ubuntu 16.04上封装boost库(需要编译的库)为动态库的时候,碰到类似错误:
relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC
开始以为是给动态库添加-fPIC,后来发现是给boost添加,
在编译boost库时,原来是
>bjam --with-xxx
现在是:
>bjam cxxflags=-fPIC cflags=-fPIC --with-xxx
已验证无问题