编译bug can not be used when making a shared object; recompile with -fPIC

/usr/bin/ld: /usr/local/lib/libgflags.a(gflags.cc.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/libgflags.a: 无法添加符号: 错误的值
collect2: error: ld returned 1 exit status
make[2]: *** [../lib/libcamodocal_gpl.so] Error 1
make[1]: *** [src/gpl/CMakeFiles/camodocal_gpl.dir/all] Error 2
make: *** [all] Error 2
src/gpl/CMakeFiles/camodocal_gpl.dir/build.make:196: recipe for target '../lib/libcamodocal_gpl.so' failed
CMakeFiles/Makefile2:285: recipe for target 'src/gpl/CMakeFiles/camodocal_gpl.dir/all' failed
Makefile:83: recipe for target 'all' failed
16:25:16: The process "/usr/bin/cmake" exited with code 2.
Error while building/deploying project camodocal (kit: Desktop)
When executing step "CMake Build"
解决方法

add_library(camodocal_chessboard Chessboard.cc)时 不要加SHARE参数

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值