I have been trying to use lua with c++, but i cant get this basic program to work properly. I tried google but i didnt get the answer This is my code:
#include <stdio.h>
extern "C" {
#include "lua.h"
#include "lualib.h"
#include "lauxlib.h"
}
lua_State* L;
int main ( int argc, char *argv[] )
{
L = lua_open();
luaL_openlibs(L);
lua_close(L);
return 0;
}
These are the errors:
main.obj : error LNK2019: unresolved external symbol _lua_close referenced in function _main
main.obj : error LNK2019: unresolved external symbol _luaL_openlibs referenced in function _main
main.obj : error LNK2019: unresolved external symbol _luaL_newstate referenced in function _main
I think that unresolved externals are to do with library files and the linker not finding functions and varibles in any file after it's read the header file.
But i put all the header files in the right place because it's not complaining about that, i put the 2 lib files that i got with the lua source code with all the other VC++ lib files