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

04-30 08:27