I am trying to write C++ classes/functions which can be accessed from Lua.
I need to export the C++ library as dll files.
I'm using Microsoft Visual C++.2010 Express
So I create a project and add the require .cpp files and .h files Now when I try to build, the following error occurs.
mylib.obj : error LNK2019: unresolved external symbol _lua_settop referenced in function "void __cdecl g_initializePlugin(struct lua_State *)" (?g_initializePlugin@@YAXPAUlua_State@@@Z)
Similar errors occur for all lua functions. When Googling I learnt that I had to link LUA.
How can that be done in Visual C++.
P.S I found a solution which directed me to give
#pragma comment( lib, "lua5.1" )
For this solution, it requires a lua5.1 file. From where should I download that file and where should it go (in the project folder?) ?
OK! I figured out how!
To link Lua, the following has to be done after the C++ project has been created.
NOTE : my lua installation is in C:\Program Files\Lua\5.1
Now on building the project, dll file is created!