找不到lua_open lua_openlib

http://blog.csdn.net/x356982611/article/details/47405351


 使用lua5.2发现编译器找不到lua_open函数,最后发现这个函数在5.2中已经被遗弃,被新的函数luaL_newstate和lua_newstate替代。lua_newstate可自定义内存分配函数,luaL_newstate使用默认的内存分配方式。


下面是5.2中头文件部分定义


[cpp]  view plain  copy
  1. /* compatibility with old module system */  
  2. #if defined(LUA_COMPAT_MODULE)  
  3.   
  4. LUALIB_API void (luaL_pushmodule) (lua_State *L, const char *modname,  
  5.                                    int sizehint);  
  6. LUALIB_API void (luaL_openlib) (lua_State *L, const char *libname,  
  7.                                 const luaL_Reg *l, int nup);  
  8.   
  9. #define luaL_register(L,n,l)    (luaL_openlib(L,(n),(l),0))  
  10.   
  11. #endif  

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值