Linux下g++编译动态库的问题relocation R_X86_64_32 against `.rodata‘ can not be used when making a shared objec
relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC问题出现原因是编译库的时候:g++ -c -fPIC c1.cppg++ -shared -fPIC -o libc1.so c1.o编译生成.o和生成lib**.so 所用的参数不一致,上一句加上-fPIC后就不存在这个问题了。即:g++ -c -fPIC c1.cpp..
原创
2020-10-25 21:20:44 ·
1840 阅读 ·
2 评论