A crash when loading dll from LuaJIT (works with "regular" Lua)

  • From: Paul Kulchenko <paulclinger@xxxxxxxxx>
  • To: "luajit@xxxxxxxxxxxxx" <luajit@xxxxxxxxxxxxx>
  • Date: Sun, 30 Dec 2012 13:34:32 -0800 (PST)

Hi Mike,

> Either you've statically linked in the Lua VM into the module
(look at its size) or you're dragging in the Lua VM as a DLL, but
under a different name. 

Spot on. I did statically linked several Lua VM methods (but I don't create a 
new VM).

So, what is the right method to do this? I need to be able to provide my own 
DLL (and .so and .dylib) that works with engines that have Lua VM statically 
compiled in (like it's done in love2d or gsl-shell) and those that have 
luaXX.dll present (and ideally to work with lua and lujit). If I link against 
luaXX.dll, then it fails with statically compiled engines (unless luaXX.dll is 
also present) and if I link those methods I use statically, it doesn't work 
with luajit.

Is there a proper way to accommodate all these cases? Or should I simply 
provide two different dlls linked statically against lua and lujit and switch 
at run time if luajit is detected? I've read various wiki pages on building lua 
proxy dlls, but they cover a slightly different issue. 


Paul.


Other related posts: