對不起,我的英文很差。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'
任何人都知道如何解決它?謝謝!