合并openjpeg/soxr/vidstab/snappy等多个cmake库时,为了解决下述问题: relocation R_X86_64_32 against `.text' can not be used when making a shared object; recompile with -fPIC分别验证过以下二种方法 第一种 (笔者所采用的,因需修改原始CMakeLists.txt文件,感觉不太方便,非常希望能在cmake命令参数中处理) add_compile_options(-
在已经存在python安装环境的情况下,当安装第三方的包的时候出现报错提示 /usr/bin/ld: .../lib/libpython2.7.a(abstract.o): relocation R_X86_64_32 against 'a local symbol' can not be used when making a shared object; recompile with -fPIC .../lib/libpython2.7.a: could not read symbols: B
gcc -shared -o hack.so hack.c/usr/bin/ld: /tmp/ccUZREwA.o: relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC/tmp/ccUZREwA.o: could not read symbols: Bad valuecollect2: ld returned 1 exit
使用google protobuf时,出现错误 /usr/bin/ld: /usr/local/lib/libprotobuf.a(message_lite.o): relocation R_X86_64_32S against `_ZTVN6google8protobuf11MessageLiteE' can not be used when making a shared object; recompile with -fPIC/usr/local/lib/libprotobuf.a: er