我的应用程序包含静态链接的lua 5.2 inteperpreter(并且无法访问代码).当我尝试使用下一个代码编写扩展时:
#define LUA_LIB
#define LUA_BUILD_AS_DLL
#include "lua.hpp"
extern "C"
{
static int test(lua_State* state)
{
return 1;
}
static const struct luaL_Reg functions[] = {
{"test", test},
{NULL, NULL},
};
int __declspec(dllexport) luaopen_test(lua_State* state)
{
luaL_newlibtable(state, functions);
luaL_setfuncs(state, functions, 0);
return 0;
}
}
Run Code Online (Sandbox Code Playgroud)
并使用静态链接的lua52.lib进行编译.当我试图从lua代码中要求它时,我收到"检测到多个vms"错误.在这种情况下我能做些什么?
lua ×1