lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

Hello again,

I am having some trouble with this and I am not sure why. Here is an example of what is happening:

/> lua
Lua 5.1  Copyright (C) 1994-2006, PUC-Rio
> sock = require("socket")
/usr/local/lib/lua/5.1/socket.lua:13: module 'socket.core' not found:
       no field package.preload['socket.core']
       no file './socket/core.lua'
       no file '/usr/local/share/lua/5.1/socket/core.lua'
       no file '/usr/local/share/lua/5.1/socket/core/init.lua'
       no file '/usr/local/lib/lua/5.1/socket/core.lua'
       no file '/usr/local/lib/lua/5.1/socket/core/init.lua'
       no file './socket/'
       no file '/usr/local/lib/lua/5.1/socket/'
       no file '/usr/local/lib/lua/5.1/'
       no file './'
       no file '/usr/local/lib/lua/5.1/'
       no file '/usr/local/lib/lua/5.1/'
stack traceback:
       [C]: in function 'require'
       /usr/local/lib/lua/5.1/socket.lua:13: in main chunk
       [C]: in function 'require'
       stdin:1: in main chunk
       [C]: ?
> print(package.preload["socket.core"])
function: 0xd0ffc0

The package.preload["socket.core"] is supposed to be the function "luaopen_socket_core", correct? Or is it supposed to be the result of calling that function?


Diego Nehab wrote:

Now I am trying to add LuaSockets to my platform and I am wondering if anyone has any tips on how I can do this. Lets just say for now that I wanted to add the LuaSocket libraries to the lua standalone interpreter in the same way as all the built in libraries (math, io, string, ...). Does anyone have any tips on what I need to do to accomplish this? Has anyone else done this?

Try reading this and let me know if it makes any sense.

Feel free to say it doesn't. :)