lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Hello,

i tried to create a simple test-programm:
"
#include <stdio.h>
extern "C"
{
#include "lua.h"
#include "lualib.h"
#include "lauxlib.h"
}

int main(int argc, char* argv[ ])
{
lua_State* luaVM = lua_open(0);

if (NULL == luaVM)
{
printf("Error Initializing lua\n");
return -1;
}

// Do stuff with lua code.


char* strLuaInput = "a = 1 + 1;\nprint( a);\n";

lua_loadstring(luaVM, strLuaInput);

lua_close(luaVM);

return 0;
}
"

If I try to compile this code (i am using msvc), i get an error
saying:
lua_loadstring is an undeclared identifier.
If I delete this line the rest compiles perfectly and I can also
build an exe-file.
Does someone know where this error comes from?

thx
Marcus Große