首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何用Premake5调试ZeroBrane

如何用Premake5调试ZeroBrane
EN

Stack Overflow用户
提问于 2017-05-12 05:23:42
回答 1查看 229关注 0票数 1

我在尝试调试Premake5 (https://github.com/premake/premake-core)时遇到了问题,在macOS塞拉利昂10.12上使用ZeroBrane调试

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

代码语言:javascript
复制
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,就会得到一个不同的错误:

代码语言:javascript
复制
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

有什么帮助吗?

谢谢

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 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中引入的)。

只要您使用的解释器与您要加载的模块的版本相匹配,您就应该能够在没有问题的情况下加载模块。

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/43929870

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档