[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: LuaBinaries - why so many Win32 versions?
- From: Stefan Sandberg <keffo.sandberg@...>
- Date: Tue, 22 Jul 2008 15:23:43 +0200
Process linked to crt X loads module jeff.dll, liked to crt Y, which
allocates mem which is deallocated in barbara.dll, linked to crt Z.
They operate on different heaps, so anything goes after this point,
perhaps your coffee machine kicks in, or your pacemaker, who knows..
Randomly tossing together libraries without knowing how they work
internally is dubious at best, and you cant rely on module writers to
write code that behaves well for your particular scenario(which -is-
incorrect).. The only way to make sure it's solid is to do it the
The point is, it's wrong to cross link crt versions, but if you want to
risk it, go for it..
Peter Cawley wrote:
Can you explain why having multiple versions of the CRT loaded into an
application (i.e. one from Lua, one from extension X, etc.) is a
timebomb? The only issue I'm aware of between CRTs is the allocation
issue, which is negated by Lua doing all the allocation of things
which "leave" an extension (userdata, etc.), but I'd love to know what
other issues there are.
2008/7/22 Stefan Sandberg <firstname.lastname@example.org>:
Lua linked to crt X can only load modules linking to the same crt X,
anything else is wrong(even if it manages to run fine for a bit, it's a
This has nothing to do with lua nor luabinaries, but the fact that windows
is an os based on binary distribution,
unlike *nices which are based on source.
Just deal with it, you can't get around it...
Paul Moore wrote:
I want to allow users of my application which embeds Lua to load
external libraries (or at least, I thought I did until I started
looking at this!) but I'm confused by all the various LuaBinaries
available for Windows. A number of libraries claim to be "compatible
with LuaBinaries", but given the number of options, I can't see what
I can see why there are multiple .lib files corresponding to different
compilers, but it appears that the various Lua DLLs are linked with
different versions of the MSVC runtime. Does this mean that extensions
need to use the same CRT as well, so that an extension compatible with
(say) lua5_1_3_Win32_dll9_lib.zip is not compatible with
If that's the case, I guess I have to leave CRT compatibility issues
to users (and accept the rish that if they get it wrong, the hosting
app may crash). Either that or use a static build of Lua and disable
Are there any other options I've missed?