0

I connected my project (C++ VS2015 & lua 5.3) to ZeroBrane IDE debugger via luasocket and all works like expected:

package.path = package.path .. ';./scripts/zerobrane/?.lua'
package.cpath = package.cpath .. ';./scripts/zerobrane/?.dll'

local debugger = require('mobdebug.mobdebug')
debugger.start()

so, I can run and debug this project.

But in my another project (C++ VS2013 & lua 5.1) I am trying to do exactly the same thing but got an error:

2016.05.17/17:33:39> lua_wrapper.cpp(47): Lua: error loading module 'socket.core' 
        from file 'D:/project2/scripts/zerobrane/socket\core.dll':
    The specified module could not be found.

LUA Call stack: 
.  C    <no name>
.  C    require
.  main  <no name> - ./scripts/zerobrane/socket.lua:12
.  C    require
.  main  <no name> - ./scripts/zerobrane/mobdebug\mobdebug.lua:101
.  C    require
.  main  <no name> - ./scripts/luadebug.lua:5
.  C    require
.  main  <no name> - ...\scripts\main.lua:6

Path to dll is correct. I also tried to place in that folder different core.dll from ZeroBraneStudio package but no luck:

  • ZeroBraneStudio\bin\clibs\socket\core.dll
  • ZeroBraneStudio\bin\clibs52\socket\core.dll
  • ZeroBraneStudio\bin\clibs53\socket\core.dll

I was going to compile core.dll myself with VS2013 but I can't find appropriate source code. This one http://files.luaforge.net/releases/luasocket/luasocket/luasocket-2.0-beta2 produce only socket.dll (rename as core.dll gives nothing).

Any ideas?

Alprog
  • 103
  • 2
  • 10
  • @AIprog Please see the linked question which I think yours duplicates. – Roddy May 17 '16 at 16:35
  • I find solution (thanks Paul Kulchenko for clue in twitter): https://twitter.com/zerobrane/status/732618632161689600 Problem was that at first project I used dynamic linkage with lua51.dll but at second project I used static linkage. Since core.dll use lua51.dll it can't be loaded. If you try to mix both linkage (by add lua51.dll) you will get access violation. So, solution is remove static linkage and use only dynamic instead. – Alprog May 18 '16 at 08:33

0 Answers0