Lua problem
Iam just trying to create a simple Lua program. Here it is
#include <stdio.h>
extern "C"
{
#include <lua.h>
}
int main(int argc, char* argv[ ])
{
lua_State* luaVM = lua_newstate(NULL);
if (NULL == luaVM)
{
printf("Error Initializing lua\n");
return -1;
}
lua_close(luaVM);
return 0;
}
but it is saying undefined reference to lue_newstate
and it says 110 too few arguments to function `lua_State* lua_newstate(void*(*)(void*, void*, size_t, size_t), void*)'
lua_newstate requires you to specify a memory allocator. You'll almost always want to use luaL_newstate, which supplies the allocator for you.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement