首页 文章
  • 1 votes
     answers
     views

    C从Lua脚本调用函数

    我正试图在我的应用程序中绑定Lua,现在我试图测试如何将Lua绑定到C中 . 我的问题很奇怪,因为我想在 luaL_loadfile 之后从脚本开始调用函数 main() . 我的代码: #include <iostream> #include <cstdlib> #include <stdio.h> #include "lua.hpp"...
  • 6 votes
     answers
     views

    Lua 5.2问题:来自lua_pcall的'attempt to call a nil value'

    我在从C调用Lua 5.2函数时遇到了问题 . 这是Lua块(名为test.lua): function testFunction () print "Hello World" end 这是C: int iErr = 0; //Create a lua state lua_State *lua = luaL_newstate(); // Load io library l...

热门问题