lua-users home
lua-l archive

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

The compiler is assuming that the external Lua symbols are C++
functions, as you can see from the mangling
'lua_close@@YAXPAUlua_State@@@Z'.  Put an 'extern 'C" {' around where
you include the Lua header files; there's also a lua.hpp in the
include dir which does this for you.

steve d.

On Fri, Jan 30, 2009 at 5:24 AM, Ben Maher <> wrote:
> All right, so I've tried the forums, I've tried help manuals, I've tried google, I've had a look through the mailing list and I can't seem to fix this problem.
> Righto, so I'm trying to i'm trying to integrate Lua with a C++ app I'm developing in Visual Studio 2005.
> Here's what I've done so far:
> I downloaded the Lua DLLs, Libraries and Include files from Lua
> Added the includes directory into the list of include files under Projects and Solutions -> VC++ directories.
> Added the library files into the list of library files under Projects and Solutions -> VC++ directories.
> Under Project Settings -> Linker -> Input I've added in Lua5.1.lib.
> Copied across Lua5.1.dll into my working directory.
> included "lua.hpp",
> which has the extern "C" around all the major headers.
> I've done all of this, and yet I can't get rid of a number of unresolved external symbol errors. For instance: "error LNK2019: unresolved external symbol "void __cdecl lua_close(struct lua_State *)" (?lua_close@@YAXPAUlua_State@@@Z) referenced in function _WinMain@16 main.obj".
> Needless to say, I would be really appreciative of any help I could get on this problem.