我的是MAC10.9,编译其它软件没问题的,就想给lua安装一个cjson模块,我的lua也是用luajit源码包编译安装的。但是装cjson模块时报错了,网上搜索了许多,找不到答案。
由于字数有限制,我省略到中间不是报错的内容:
huangwhMac:lua-cjson-2.1.0 huangwh$ make
cc -shared -o cjson.so lua_cjson.o strbuf.o fpconv.o
Undefined symbols for architecture x86_64:
"_luaL_argerror", referenced from:
_json_protect_conversion in lua_cjson.o
_json_encode in lua_cjson.o
_json_decode in lua_cjson.o
_json_cfg_encode_sparse_array in lua_cjson.o
_json_cfg_encode_max_depth in lua_cjson.o
_json_cfg_decode_max_depth in lua_cjson.o
_json_cfg_encode_number_precision in lua_cjson.o
......
"_lua_typename", referenced from:
_json_append_data in lua_cjson.o
_json_append_number in lua_cjson.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [cjson.so] Error 1
就这样。
另外,我在centos下编译成功的CJSON.OS文件放到lua目录下去,也无法使用