relocation 错误

icc test/train/test_lm2.o -shared -lpthread -ldl ./lib/liblm2.a -o liblm2.so

ld: ./lib/liblm2.a(cJSON.o): relocation R_X86_64_32 can not be used when making a shared object; recompile with -fPIC
./lib/liblm2.a: could not read symbols: Bad value

错误原因:静态库里面cJSON.c 编译没有加-fPIC

posted on 2016-08-26 15:00  袁军峰  阅读(347)  评论(0编辑  收藏  举报

导航