2017-05-12 29 views
1
我在試圖在MacOS塞拉利昂10.12調試Premake5( https://github.com/premake/premake-core),使用ZeroBrane

如何使用ZeroBrane

我已經添加了package.cpath和package.path問題

調試Premake5(之前叫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 

有任何幫助嗎?

感謝

回答

2

你似乎是使用一個版本的Lua在Premake的是從luasocket庫被編譯的版本不同。 "file is not a bundle"是Lua 5.1消息,當文件加載器無法在MacOS上加載動態庫時出現NSObjectFileImageInappropriateFile錯誤時顯示該消息。在這種情況下,您正在從Lua 5.1解釋器(/Applications/ZeroBraneStudio.app/Contents/ZeroBraneStudio/bin/clibs53/socket/core.dylib)加載爲Lua 5.3編譯的庫。

在您正在實際加載的Lua 5.1庫(/Applications/ZeroBraneStudio.app/Contents/ZeroBraneStudio/bin/clibs/socket/core.dylib)第二種情況,但考慮到錯誤消息(Symbol not found: _luaL_prepbuffsize),你似乎是從Lua 5.2或Lua的5.3解釋器加載它(如luaL_prefbuffsize是在Lua 5.2引入) 。

只要您使用的解釋器與您嘗試加載的模塊的版本相匹配,您就應該可以加載模塊而不會出現任何問題。

+0

事實上,我混淆了一些事情。 順便說一句,我終於能夠對Premake中的lua項目進行一些小的修改。 我已經定義了LUA_USE_DLOPEN,LUA_COMPAT_OPENLIB和LUA_COMPAT_LOADLIB,它與ZeroBrane完美協作。 –

+0

聽起來不錯;如果它適合你,你可以接受答案。 –