s1gtrap
s1gtrap

Reputation: 150

Statically linking Lua using Visual Studio 14

I'm trying to link the latest Lua library with my x86 application using Visual Studio 14. I added the library under additional dependencies, and included the appropriate header files (lua.hpp, I also tried the manual extern "C" approach.) I'm compiling my module as a x86 binary and using the right Lua binaries (x86.) The error I get is the following:

LNK2019 unresolved external symbol "struct lua_State * __cdecl luaL_newstate(void)" (?luaL_newstate@@YAPAUlua_State@@XZ) referenced in function _DllMain@12

Obviously the header files have declared the luaL_newstate function, but looking at the supplied binary's (lua53.lib) symbols, it's quite clear that it doesn't actually supply any symbol named as such - instead it has one named _luaL_newstate.

What am I doing wrong here?

Upvotes: 1

Views: 554

Answers (1)

s1gtrap
s1gtrap

Reputation: 150

I figured it out, I had included the C headers (lua.h, lauxlib.h etc.) elsewhere. Removing those fixed my issue.

Upvotes: 1

Related Questions