Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- extern "C" {
- #include "lua.h"
- #include "lualib.h"
- #include "lauxlib.h"
- }
- int main()
- {
- lua_State *L = lua_open();
- luaopen_base(l);
- luaopen_table(l);
- luaopen_string(l);
- luaopen_math(l);
- luaopen_loadlib(l);
- int s = luaL_loadfile(L,"test.lua");
- if ( s==0 ) {
- // execute Lua program
- s = lua_pcall(L, 0, LUA_MULTRET, 0);
- }
- lua_close(l);
- lua_close(l);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement