[ZeroBrane Studio] Re: error loading module 'socket.core'

  • From: "Steve Russell" <steve.russell@xxxxxxxxxxxxxxxxxxxxx>
  • To: <zerobrane@xxxxxxxxxxxxx>
  • Date: Mon, 15 Sep 2014 16:18:07 +0100

Hi,

Some success! :-)

Perhaps there was a path issue & another dll was being loaded.  I confirmed my 
app needed the dll be renaming all lu52.dlls in the system (Wireshark had one 
too) & with all dlls renamed my app failed to start.  If I compile my source to 
create a lua52.dll & use that dll in the ZB folder both my app & ZB run using 
the one dll. Great.

If I start & stop my app during a debug session, having successfully connected 
and debugged, I occasionally get "Debugger connection unexpectedly closed" in 
the script & I'm unable to connect again, even after restarting ZB & my script. 
I'll test further.

Also, is it possible to set variable values or perform condition?

Many thanks.

Steve

-----Original Message-----
From: zerobrane-bounce@xxxxxxxxxxxxx [mailto:zerobrane-bounce@xxxxxxxxxxxxx] On 
Behalf Of Paul K
Sent: 12 September 2014 16:59
To: zerobrane@xxxxxxxxxxxxx
Subject: [ZeroBrane Studio] Re: error loading module 'socket.core'

Hi Steve,

> "Multiple Lua VMs detected"
> When this line is uncommented:
> -- require("mobdebug").start()

This usually points to a situation when you have Lua statically compiled, but 
try to load a module that is linked against lua DLL and it finds that DLL, so 
you end up with two different VMs.

> I even removed my Lua52.dll (compiled from source) and set the path to 
> include the one you ship with ZB and get the same error.  My code as far as I 
> know is compiled against the Lua dll I create & does not link code statically.

I'd double check if that is indeed the case. Try running your application 
without pointing to Lua dll at all (whether to yours or to one from ZBS). If it 
still works, this means you have the Lua interpreter statically compiled (which 
I suspect is the case). If it doesn't work, we'll need to figure out where the 
second DLL comes from.

If you do indeed have the DLL statically compiled, you then have two choices. 
You can either change it to load dynamically (which will make it work), or will 
need to compile a small "proxy" dll, which will have the same lua52.dll, but 
will actually forward requests to the statically compiled interpreter (you'll 
need to export Lua symbols when you compile your application). It requires this 
proxy dll
(http://lua-users.org/wiki/LuaProxyDllFour) and your statically compiled app 
should export required symbols; see this discussion for instructions and 
details:
http://lua-users.org/lists/lua-l/2013-11/msg00831.html

Paul.


Other related posts: