对不起,我的英文很差。mips-openwrt-linux-gcc:链接lua lib错误
我想在openwrt 14.07上的c app中调用lua函数。 当交叉编译项目时,我无法在工具链中找到lua的头文件和.so文件。所以我把ubuntu 14.04和liblua.so中的lua51文件夹从目标操作系统复制到工具链中。然后尝试编译该项目,得到未定义的引用错误。
mips-openwrt-linux-gcc airkiss.c luaconf.c -lpthread -llua libairkiss_log.a
-L. -o airkiss -Wl,-rpath-link=/opt/OpenWrt-Toolchain-ar71xx-for-mips_34kc-gcc-4.8-linaro_uClibc-0.9.33.2/toolchain-mips_34kc_gcc-4.8-linaro_uClibc-0.9.33.2/lib
我得到了错误:
luaconf.c:(.text+0x18): undefined reference to `luaL_newstate'
luaconf.c:(.text+0x28): undefined reference to `luaL_openlibs'
luaconf.c:(.text+0x3c): undefined reference to `luaL_loadfile'
luaconf.c:(.text+0x54): undefined reference to `lua_getfield'
luaconf.c:(.text+0x64): undefined reference to `lua_pushstring'
luaconf.c:(.text+0x74): undefined reference to `lua_pushstring'
luaconf.c:(.text+0x8c): undefined reference to `lua_pcall'
luaconf.c:(.text+0xa0): undefined reference to `lua_tolstring'
luaconf.c:(.text+0xc0): undefined reference to `lua_close'
任何人都知道如何解决它?谢谢!