在编译过程中出先如下 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)