relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC

CMakeLists.txt 添加以下内容:

 
SET(CMAKE_CXX_FLAGS "-fPIC")

SET(CMAKE_C_FLAGS "-fPIC")

有关fPIC介绍

https://www.cnblogs.com/cswuyg/p/3830703.html

 

参考:https://blog.csdn.net/jobbofhe/article/details/78972914

https://blog.csdn.net/chengde6896383/article/details/93737256

 

posted @ 2023-08-29 10:08  飞飞龙  阅读(154)  评论(0)    收藏  举报