我在尝试调试Premake5 (https://github.com/premake/premake-core)时遇到了问题,在macOS塞拉利昂10.12上使用ZeroBrane调试
我添加了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有什么帮助吗?
谢谢
发布于 2017-05-12 05:51:51
您似乎在预置中使用Lua的版本,这与编译luasocket库所用的版本不同。"file is not a bundle"是一个Lua5.1消息,当文件加载器无法在MacOS上加载带有NSObjectFileImageInappropriateFile错误的动态库时,将显示该消息。在本例中,您将从Lua5.1解释器(/Applications/ZeroBraneStudio.app/Contents/ZeroBraneStudio/bin/clibs53/socket/core.dylib)加载为Lua5.3编译的库。
在第二种情况下,您实际上正在加载Lua5.1库(/Applications/ZeroBraneStudio.app/Contents/ZeroBraneStudio/bin/clibs/socket/core.dylib),但考虑到错误消息(Symbol not found: _luaL_prepbuffsize),您似乎是从Lua5.2或Lua5.3解释器加载它(因为luaL_prefbuffsize是在Lua5.2中引入的)。
只要您使用的解释器与您要加载的模块的版本相匹配,您就应该能够在没有问题的情况下加载模块。
https://stackoverflow.com/questions/43929870
复制相似问题