lua-users home
lua-l archive

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

Definitely, libraries should be binary compatible between different

Since there are no symlinks in windows, the name of the library should be
lua4.0.dll not lua4.0.1.dll. Modules linked against different revisions
should be binary compatible, so if I link against lua4.0.0.dll and you are
using lua4.0.1 it should 'still' work.

Martin Spernau wrote:
> I have set up my binaries to consist of
> a) lua4.0.1.dll (I don't care about the name, as long as we agree)
> -> this contains everything a standard lua.exe would have plus the
> loadmodule functionality

The loadmodule functionality is provided by lua.exe not by the dll.

> Your setup contains two dlls and the exe:
> lua-4.0.dll
> lualib-4.0.dll
> lua.exe
> So binary modules you compile will not run with my lua.exe, and the other
> way around.

I use two libraries, one for the core and one for the libraries, because
that's what it's done in other systems. Have a look at the makefiles, I just
translated this:

ld -o lib/$V -shared src/*.o
ld -o lib/$V -shared src/lib/*.o

into this:

DLLWRAP --def lib/liblua.def --implib lib/liblua.a src/*.o
$(DLLWRAP_OPTS) -o bin/lua-$V.dll
DLLWRAP --def lib/liblualib.def --implib lib/liblualib.a src/lib/*.o
$(DLLWRAP_OPTS) -L$(LIB) -llua -o bin/lualib-$V.dll

that is the MinGW equivalent.

To link your executable against those libraries, you have to create a .lib
file, that's done with:

lib /machine:i386 /def:liblua.def
lib /machine:i386 /def:liblualib.def

I'll also include .lib files in the package.

> One concern for me is the fact that each split in another dll will
> overall size.
> (apparently thats a problem I'm seeing because I use VC, my compiled
> version of luapacklib.dll is 48kb, where your's is 7kb!!!)

Are you sure that you are dynamic linking packlib against the lua dll? I
tested that under VC and I got a file of about 9kb.

> I think so too, but the internal version (the one loadmodule checks) would
> be 4.0.1, so the name _could_ be confusing
> Maybe ignoring the minor version in loadmodule.c is a good idea, as I also
> guess that lua 4.0 and 4.0.1 modules would be compatible already.

yeah, that has to be fixed somehow.

Ignacio Castaño

Copa del Mundo de la FIFA 2002
El único lugar de Internet con vídeos de los 64 partidos. 
¡Apúntante ya! en