Question

I am working with visual studio 2012 to compile LuaJava. The problem I am having is when I call the linker. The line that calls the linker in the makefile is:

 link  /dll /LIBPATH:"C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Lib\x64" 
       /LIBPATH:"C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\lib\amd64" 
       /out:luajava-1.1.dll src\c\luajava.obj 
       "C:\Program Files (x86)\Lua\5.1\lib\lua5.1.lib" /VERBOSE

This seems to almost be linking everything successfully, until it gets to the Lua library.

The linker outputs the following when I try to make the project:

...//linking of other libraries
Finished searching libraries

Unused libraries:
  C:\Program Files (x86)\Lua\5.1\lib\lua5.1.lib
  C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\lib\amd64\OLDNAMES.lib

luajava.obj : error LNK2019: unresolved external symbol lua_close referenced in function Java_org_keplerproject_luajava_LuaState__1close
luajava.obj : error LNK2019: unresolved external symbol lua_newthread referenced in function Java_org_keplerproject_luajava_LuaState__1newthread
luajava.obj : error LNK2019: unresolved external symbol lua_gettop referenced in function Java_org_keplerproject_luajava_LuaState__1getTop
...//lots of these errors 
luajava-1.1.dll : fatal error LNK1120: 88 unresolved externals
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\BIN\x86_amd64\link.EXE"' : return code '0x460'
Stop.

I'm confused as to why it says that the Lua library is unused, and then complains when it can't find the Lua library functions.

No correct solution

OTHER TIPS

You can not link a 32 bit library to your 64 bit application. After some searces I do not believe LuaJava has a x64 download so to use this you must change your application to 32 bit.

Edit: A second method would be to recomile LuaJava as a 64 bit dll. Here is a very recent post about that: LuaJava compile error "Unresolved external symbol"

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top