lua-users home
lua-l archive

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


Hi All,

I ran into an issue with using dlls and applications compiled by
different compilers on Windows. I know the general advice is "don't do
it", but unfortunately, I don't quite have a choice.

Here is my situation. ZeroBrane Studio ships with luasocket compiled
using mingw (all other ZBS components are also compiled using the same
compiler). However, a user may debug an application that is compiled
by a different compiler; for example love2d is compiled using Visual
Studio. When the application is being debugged, it loads luasocket
from ZBS (if it's not available in the application) and while
everything works correctly most of the time, in some rare cases the
user gets this dreaded "This application has requested the Runtime to
terminate it in an unusual way" error. I've managed to trace it to
socket.select call, but still not sure what exactly is causing this
crash (as I don't see a way to debug it postmortem).

The question is this: what are the real reasons behind advice to not
mix DLLs compiled with different compilers? Why is everything working
correctly (even socket.select), but in some (quite rare, but still
reproducible) cases things go wrong? Would it be better to replace the
current luasocket libraries with the ones compiled using VS and use
them from apps compiled by VS and mingw? (I tried this for some short
time and didn't come across any issues yet). Is anyone using mixed
DLLs (especially luasocket) on a regular basis? Any other options I
should consider? Thank you.

Paul.