lua-users home
lua-l archive

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


On Wed, Aug 18, 2010 at 05:34:29PM -0300, Fabio Mascarenhas wrote:
> You might have more than one copy of either the C runtime or the Lua
> runtime loaded.

I do really have lack of knowledge how this can happen. So I
do not know if this is the case. I hope not.

> Are your lua51.exe, lua51.dll and Alien dlls linked
> against msvcrt.dll?

When compiling any .exe or .dll I do not explicitly mention msvcrt.dll
in command line ever. I think i586-mingw32msvc-gcc does link it by
default to msvcrt.dll (same as I do not explicitly link to libc.so
library when compiling for linux).
The only place where I do mention msvcrt.dll is that I changed
alien's libc.lua example as Steve Donovan have suggested.

> And are the alien.dlls and lua51.exe linked against lua51.dll? 

Yes they are. For example core.dll is compiled like this:

${CC} -shared -s $(CFLAGS) -L../installed -llua51 -o src/alien/core.dll src/alien/core.c libffi/win32/libffi.a

If I remove '-L../installed -llua51' from that command than it does not
link and complain about unresolved references to Lua C API functions.

> Mixing different runtimes can lead to these weird errors.

Is there some way to verify if I have mixed different runtimes?
Or if they are loaded multiple times?

Maybe it will be useful to explain how do I compile and test.
I do my compilation on Debian Lenny with mingw32 cross
compiler. Then I run compiled code under wine (and eventually
under Windows XP when I reboot my box - running libc.lua example
under XP crashes at the same line as under wine and it popup
a dialog with this message :
  " lua.exe has encountered a problem and needs to close. We are sorry
    for the inconvenience. "
and than popup wants to report by email to Microsoft details about
the crash.)
So lua.exe is linked to lua51.dll as are all other modules I
compiled (LuaBitOp, lpeg, luasocket, luasqlite3, lxyssl and now alien)
All the modules works fine (as much as I tested them :) only alien
gives me a headache.

Martin