Advertisement
Guest User

Untitled

a guest
Oct 25th, 2014
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. extern "C" {
  2. #include "lua.h"
  3. #include "lualib.h"
  4. #include "lauxlib.h"
  5. }
  6.  
  7. int main()
  8. {
  9. lua_State *L = lua_open();
  10. luaopen_base(l);
  11. luaopen_table(l);
  12. luaopen_string(l);
  13. luaopen_math(l);
  14. luaopen_loadlib(l);
  15.  
  16. int s = luaL_loadfile(L,"test.lua");
  17.  
  18. if ( s==0 ) {
  19. // execute Lua program
  20. s = lua_pcall(L, 0, LUA_MULTRET, 0);
  21. }
  22.  
  23. lua_close(l);
  24.  
  25. lua_close(l);
  26. return 0;
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement