#pragma comment (lib, "lua5.1.lib")
#include <conio.h>
extern "C"{
#include "lua.h"
#include "lualib.h"
#include "lauxlib.h"
}
int main()
{
// Create and start our environment
lua_State *EnvOne = lua_open();
// Load libs
luaL_openlibs(EnvOne);
// Run our "test.lua" file
luaL_dofile(EnvOne, "test.lua");
// Close our environment
lua_close(EnvOne);
// Get a character
getchar();
return 0;
}
原文地址:https://www.cnblogs.com/otfsenter/p/8467289.html
时间: 2024-10-10 21:17:47