C++调用lua编译报错

来源:互联网 发布:第三方支付数据 编辑:程序博客网 时间:2024/05/16 13:38
编译的时候
#g++ -o luac  luac.cpp  -llua -ldl


编译但是错误信息
c.cpp: In function `int main()':
luac.cpp:43: error: `lua_baselibopen' was not declared in this scope

luac.cpp:46: error: `lua_dofile' was not declared in this scope


解决方法:

改成
luaopen_base(L);
luaL_dofile(L, "add.lua");

原创粉丝点击