0
我试图在安装在Ubuntu 16.04的Eclipse Luna中使用Lua 5.1和luasocket。在Eclipse(Ubuntu 16.04)中使用luasocket时出错
我已经安装的Lua 5.1和3.0 LuaSocket-RC1和我可以运行命令行该程序(LUA main.lua):
print(_VERSION)
print("Path: "..package.path..'\nCPATH: '..package.cpath)
socket = require("socket")
print(socket._VERSION)
,其结果是:
$ lua main.lua
Lua 5.1
Path: ./?.lua;/usr/local/share/lua/5.1/?.lua;/usr/local/share/lua/5.1/?/init.lua;/usr/local/lib/lua/5.1/?.lua;/usr/local/lib/lua/5.1/?/init.lua;/usr/share/lua/5.1/?.lua;/usr/share/lua/5.1/?/init.lua
CPATH: ./?.so;/usr/local/lib/lua/5.1/?.so;/usr/lib/x86_64-linux-gnu/lua/5.1/?.so;/usr/lib/lua/5.1/?.so;/usr/local/lib/lua/5.1/loadall.so
LuaSocket 3.0-rc1
但是当我尝试使用安装了Eclipse和Lua插件来运行同一程序,我得到这个:
Lua 5.1
Path: ;./?.lua;/usr/local/share/lua/5.1/?.lua;/usr/local/share/lua/5.1/?/init.lua;/usr/local/lib/lua/5.1/?.lua;/usr/local/lib/lua/5.1/?/init.lua;/usr/share/lua/5.1/?.lua;/usr/share/lua/5.1/?/init.lua;/media/meslin/16E65872E6585459/Users/meslin/Google Drive/workspace-desktop-ubuntu/Lua Alo Mundo/src/?.lua;/media/meslin/16E65872E6585459/Users/meslin/Google Drive/workspace-desktop-ubuntu/Lua Alo Mundo/src/?/init.lua;/media/meslin/16E65872E6585459/Users/meslin/Google Drive/workspace-desktop-ubuntu/Lua Alo Mundo/src/?.luac;/media/meslin/16E65872E6585459/Users/meslin/Google Drive/workspace-desktop-ubuntu/Lua Alo Mundo/src/?/init.luac;
CPATH: ./?.so;/usr/local/lib/lua/5.1/?.so;/usr/lib/lua/5.1/?.so;/usr/local/lib/lua/5.1/loadall.so
Exception in thread "main" com.naef.jnlua.LuaRuntimeException: error loading module 'socket.core' from file '/usr/local/lib/lua/5.1/socket/core.so':
/usr/local/lib/lua/5.1/socket/core.so: undefined symbol: lua_gettop
at com.naef.jnlua.LuaState.lua_pcall(Native Method)
at com.naef.jnlua.LuaState.call(LuaState.java:555)
at org.eclipse.ldt.support.lua51.internal.interpreter.JNLua51Launcher.run(JNLua51Launcher.java:128)
at org.eclipse.ldt.support.lua51.internal.interpreter.JNLua51Launcher.main(JNLua51Launcher.java:143)
任何IDE如?你能帮我吗?
感谢 亚历山大
谢谢Paul Kulchenko。有用!!! – Alex8752