linux生成动态库时遇到了relocation R_X86_64_32 against `luaO_nilobject_' can not be used when making a shared object; recompile with -fPIC错误。
-fPIC作用于编译阶段,告诉编译器产生与位置无关代码(Position-Independent Code),
所以,编译共享库需要-fPIC参数,编译的每个.o目标文件也需要-fPIC参数
linux生成动态库时遇到了relocation R_X86_64_32 against `luaO_nilobject_' can not be used when making a shared object; recompile with -fPIC错误。
-fPIC作用于编译阶段,告诉编译器产生与位置无关代码(Position-Independent Code),
所以,编译共享库需要-fPIC参数,编译的每个.o目标文件也需要-fPIC参数