Original Post
heey all, i've tried to embed lua into C++. i'm using this code: but when i run it i get this error:
extern "C" {
#include "lua.h"
#include "lualib.h"
#include "lauxlib.h"
}
#include <stdio.h>
int main()
{
int s=0;
lua_State *L = lua_open();
luaopen_base(L);
luaopen_table(L);
luaopen_io(L);
luaopen_string(L);
luaopen_math(L);
//run a Lua scrip here
luaL_dofile(L, "lua/startup.lua");
printf("\nI am done with Lua in C++.\n");
lua_close(L);
}
Quote:any idea's how to solve this error? i'm using: Visual C++ 2008 lua 5.1.4 i'm linking to: lua5.1.lib
PANIC: unprotected error in call to Lua API (no calling environment)