lua-users home
lua-l archive

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



That did the trick. Went under properties->advanced->Compile as C code and tried the resulting lua.lib in the other app.

No more linking errors.


I'm new to C++ and this compiler. Thank you for your insight! :)

- Dennis



On Sun, 17 Sep 2006, Asko Kauppi wrote:


Are you compiling it as C++? Lua compiles both as ANSI C and as valid C++, it does _not_ declare its external functions extern "C" as most others do. This is by purpose.

You may use the etc/lua.hpp header, to have the extern declarations.

-asko


dennis@demarco.com kirjoitti 17.9.2006 kello 23.27:

 Hello all,


I'm having some difficulty creating a Static Libary (lua.lib) in Visual C++ 2005 using Lua 5.11 and compiling it from source.

When I compile Lua and get the lua.lib it seems to generate the library.. If I use that lib to link with a test program I get the following errors:

luaadd.obj : error LNK2019: unresolved external symbol _lua_close referenced in function _main

unresolved external symbol _lua_settop referenced in function "int __cdecl luaadd(int,int)" (?luaadd@@YAHHH@Z)

 and a bunch of other errors of missing symbols.


As a test, I downloaded the lua5_1_Win32_vc8.tar and used lua5.1.lib in my test program and it linked fine and worked.

 What am I doing wrong when I compile the static lib from scratch?

I'm rather confused, as I was able to compile it as an executable and run some of the test.lua scripts fine (lua.exe) When I change the option to lib it seems it is leaving out some important symbols. Is there something I'm missing in the project file?


 Thank you for your time,
 Dennis




!DSPAM:450db3ea19712201519324!