0
点赞
收藏
分享

微信扫一扫

dangerous relocation: unsupported relocation 解决方案

蛇发女妖 2022-01-12 阅读 305
linux

在编译过程中出先如下 error log

usr/bin/ld: CMakeFiles/Atlas.dir///host/des_engine.cpp.o: relocation R_AARCH64_ADR_PREL_PG_HI21 against symbol `_ZTV9DesEngine’ which may bind externally can not be used when making a shared object; recompile with -fPIC
dangerous relocation: unsupported relocation
elocation R_AARCH64_ADR_PREL_PG_HI21 against symbol may bind externally can not be used

解决方法:
只需要在CMake中添加 -fPIC选项即可:
add_compile_options(-fPIC)

举报

相关推荐

0 条评论