三个c语言文件互相调用例子,lua和c/c++互相调用实例分析

# re: lua和c/c++互相调用实例分析[未登录]

2012-04-24 14:56

jerome

为什么我不能编译

]# gcc testlua.C -llua -lm -ldl -I/usr/local/include/ -L/usr/local/lib/ -o testlua

/tmp/ccIkmvNG.o: In function `csum(lua_State*)':

testlua.C:(.text+0x16): undefined reference to `lua_tointeger(lua_State*, int)'

testlua.C:(.text+0x27): undefined reference to `lua_tointeger(lua_State*, int)'

testlua.C:(.text+0x3c): undefined reference to `lua_pushinteger(lua_State*, long)'

/tmp/ccIkmvNG.o: In function `main':

testlua.C:(.text+0x59): undefined reference to `luaL_newstate()'

testlua.C:(.text+0x8d): undefined reference to `luaL_loadfile(lua_State*, char const*)'

testlua.C:(.text+0xc4): undefined reference to `lua_pcall(lua_State*, int, int, int)'

testlua.C:(.text+0xf6): undefined reference to `lua_getfield(lua_State*, int, char const*)'

testlua.C:(.text+0x109): undefined reference to `lua_getfield(lua_State*, int, char const*)'

testlua.C:(.text+0x117): undefined reference to `lua_tointeger(lua_State*, int)'

testlua.C:(.text+0x128): undefined reference to `lua_tointeger(lua_State*, int)'

testlua.C:(.text+0x14b): undefined reference to `lua_settop(lua_State*, int)'

testlua.C:(.text+0x16c): undefined reference to `lua_getfield(lua_State*, int, char const*)'

testlua.C:(.text+0x17b): undefined reference to `lua_pushinteger(lua_State*, long)'

testlua.C:(.text+0x18a): undefined reference to `lua_pushinteger(lua_State*, long)'

testlua.C:(.text+0x1a2): undefined reference to `lua_pcall(lua_State*, int, int, int)'

testlua.C:(.text+0x1be): undefined reference to `lua_tolstring(lua_State*, int, unsigned long*)'

testlua.C:(.text+0x1ea): undefined reference to `lua_tointeger(lua_State*, int)'

testlua.C:(.text+0x210): undefined reference to `lua_settop(lua_State*, int)'

testlua.C:(.text+0x24b): undefined reference to `lua_getfield(lua_State*, int, char const*)'

testlua.C:(.text+0x258): undefined reference to `lua_pushstring(lua_State*, char const*)'

testlua.C:(.text+0x265): undefined reference to `lua_pushstring(lua_State*, char const*)'

testlua.C:(.text+0x27d): undefined reference to `lua_pcall(lua_State*, int, int, int)'

testlua.C:(.text+0x299): undefined reference to `lua_tolstring(lua_State*, int, unsigned long*)'

testlua.C:(.text+0x2ca): undefined reference to `lua_tolstring(lua_State*, int, unsigned long*)'

testlua.C:(.text+0x2f2): undefined reference to `lua_settop(lua_State*, int)'

testlua.C:(.text+0x305): undefined reference to `lua_pushcclosure(lua_State*, int (*)(lua_State*), int)'

testlua.C:(.text+0x318): undefined reference to `lua_setfield(lua_State*, int, char const*)'

testlua.C:(.text+0x32b): undefined reference to `lua_getfield(lua_State*, int, char const*)'

testlua.C:(.text+0x33a): undefined reference to `lua_pushinteger(lua_State*, long)'

testlua.C:(.text+0x349): undefined reference to `lua_pushinteger(lua_State*, long)'

testlua.C:(.text+0x361): undefined reference to `lua_pcall(lua_State*, int, int, int)'

testlua.C:(.text+0x37d): undefined reference to `lua_tolstring(lua_State*, int, unsigned long*)'

testlua.C:(.text+0x3a6): undefined reference to `lua_tointeger(lua_State*, int)'

testlua.C:(.text+0x3cc): undefined reference to `lua_settop(lua_State*, int)'

testlua.C:(.text+0x3d5): undefined reference to `lua_close(lua_State*)'

/tmp/ccIkmvNG.o:(.eh_frame+0x12): undefined reference to `__gxx_personality_v0'

collect2: ld returned 1 exit status

回复  更多评论

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值