您的位置:首页 > 编程语言 > Lua

C++调用lua编译报错

2011-10-22 11:28 295 查看
编译的时候

#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");
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: