Sign in to follow this  
mattnenterprise

Lua problem

Recommended Posts

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*)'

Share this post


Link to post
Share on other sites
lua_newstate requires you to specify a memory allocator. You'll almost always want to use luaL_newstate, which supplies the allocator for you.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this