lua-users home
lua-l archive

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


于2011年9月3日 2:20:46,Stefan Reich写到:
Thanks very much for the answer. Can I bother you one more time?

I'm doing this:

R:\coding\Lua\pluto-2.4>c:\mingw\bin\gcc -shared -L. -o pluto.dll
-llua5.1 pluto.c pdep.c lzio.c

lua5.1.lib and lua5.1.dll are in the current dir. It gives me a load
of unresolved references:

[...]
C:\Users\doc\AppData\Local\Temp\cccTXc2I.o:pluto.c:(.text+0x358c):
undefined reference to `luaL_checktype'
C:\Users\doc\AppData\Local\Temp\cccTXc2I.o:pluto.c:(.text+0x35f7):
undefined reference to `luaL_openlib'
C:\Users\doc\AppData\Local\Temp\ccgYa5Qf.o:pdep.c:(.text+0x536):
undefined reference to `lua_pushlstring'
C:\Users\doc\AppData\Local\Temp\ccgYa5Qf.o:pdep.c:(.text+0x557):
undefined reference to `lua_settop'

Shouldn't these be found in lua5.1.dll...?

-Stefan


yes, it SHOULD be in lua5.1.dll and lua5.1.lib,
the problem is, I guess, that you put the `-llua5.1' flag in the wrong position.
try putting the `-llua5.1' after `pluto.c pdep.c lzio.c'.

the order in which the object files and library files appear in the commandline
has special meanning for the linker.
it indicates the cross reference dependency order.

this is a designed feature for the linker, though many people think it causes confusion.


if you still have problem, maybe you have a ill configured and built lua5.1.lib (and maybe the lua5.1.dll).
you may try build a good lua5.1.lib yourself.