lua-users home
lua-l archive

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


Yup.

This would really break you, when you happen to malloc() from function in one runtime, and free() in another.

Or fopen() from one and, fclose() from another.
Or just _open(), and _close()



On 8/26/2011 3:54 PM, Ross Berteig wrote:
At 03:15 PM 8/26/2011, you wrote:
....
I built LuaJIT under mingw
(http://sourceforge.net/p/safelua/wiki/LuaJIT%20binaries/) and then
put in LuaSocket (the binary from
http://luaforge.net/frs/download.php/2666/luasocket-2.0.2-lua-5.1.2-Win32-vc8.zip).


That combination uses a different versions of the C runtime library.
LuaJIT will be linked against MSVCRT.DLL from VC6.0, and luasocket
against MSVCR80.DLL from VC8.0. Mixing C runtime DLLs is technically
possible, but an easy pathway to madness.

A simple answer that always works is that you need to use the same C
runtime for the EXE and every DLL, and there should be only one instance
of the C runtime which in practice means it is dynamically linked, not
statically linked to any component.


Ross Berteig Ross@CheshireEng.com
Cheshire Engineering Corp. http://www.CheshireEng.com/