Macos 如何使用ZeroBrane调试Premake5

Macos 如何使用ZeroBrane调试Premake5,macos,debugging,lua,premake,zerobrane,Macos,Debugging,Lua,Premake,Zerobrane,我在使用ZeroBrane调试macOS Sierra 10.12上的Premake5()时遇到问题 我已经添加了package.cpath和package.path(在调用require('mobdebug').start())之前,如ZeroBrane文档中所述,但我总是有相同的错误: Error: error loading module 'socket.core' from file '/Applications/ZeroBraneStudio.app/Contents/ZeroBran

我在使用ZeroBrane调试macOS Sierra 10.12上的Premake5()时遇到问题

我已经添加了package.cpath和package.path(在调用
require('mobdebug').start()
)之前,如ZeroBrane文档中所述,但我总是有相同的错误:

Error: error loading module 'socket.core' from file '/Applications/ZeroBraneStudio.app/Contents/ZeroBraneStudio/bin/clibs53/socket/core.dylib':
    file is not a bundle
或者,如果我用Lua_USE_DLOPEN重新编译Lua,我会得到一个不同的错误:

Error: error loading module 'socket.core' from file '/Applications/ZeroBraneStudio.app/Contents/ZeroBraneStudio/bin/clibs/socket/core.dylib':
    dlopen(/Applications/ZeroBraneStudio.app/Contents/ZeroBraneStudio/bin/clibs/socket/core.dylib, 2): Symbol not found: _luaL_prepbuffsize
  Referenced from: /Applications/ZeroBraneStudio.app/Contents/ZeroBraneStudio/bin/clibs/socket/core.dylib
  Expected in: flat namespace
 in /Applications/ZeroBraneStudio.app/Contents/ZeroBraneStudio/bin/clibs/socket/core.dylib
有什么帮助吗


谢谢

您似乎在Premake中使用的Lua版本与编译luasocket库的版本不同<代码>“文件不是捆绑包”是一条Lua 5.1消息,当文件加载器无法在MacOS上加载动态库时,会显示该消息,并出现
NSObjectFileImageInappropriateFile
错误。在本例中,您正在从Lua5.1解释器加载为Lua5.3编译的库(
/Applications/ZeroBraneStudio.app/Contents/ZeroBraneStudio/bin/clibs53/socket/core.dylib

在第二种情况下,您实际上正在加载Lua5.1库(
/Applications/ZeroBraneStudio.app/Contents/ZeroBraneStudio/bin/clibs/socket/core.dylib
),但给出了错误消息(
未找到符号:\u luaL\u prepbuffsize
),您似乎正在从Lua5.2或Lua5.3解释器加载它(Lua 5.2中引入了
luaL_-size


只要您使用的解释器与您试图加载的模块的版本匹配,您就应该能够加载模块而不会出现问题。

事实上,我把事情弄混了。顺便说一句,我终于能够让它在Premake中对lua项目进行一些小的更改。我已经定义了lua_use_DLOPEN、lua_COMPAT_OPENLIB和lua_COMPAT_LOADLIB在它与ZeroBrane完美配合。