Lune linking problems.

Posted by Robert Powell on Sun 06 Jul 2008 04:51 AM — 8 posts, 31,385 views.

Australia #0
Im having trouble getting lune, a lua mud server to link. I really dont know whats going on, or how to go about fixind it, about the only thing i can think of is differences betwen versions of lua.

here is the output,

luasocket.c:(.text+0xd5): undefined reference to `lua_newtag'
luasocket.c:(.text+0xe5): undefined reference to `lua_newtag'
luasocket.c:(.text+0xf6): undefined reference to `lua_newtag'
luasocket.c:(.text+0x107): undefined reference to `lua_newtag'
luasocket.c:(.text+0x1c0): undefined reference to `lua_settagmethod'
luasocket.o: In function `get_sock':
luasocket.c:(.text+0x2ed): undefined reference to `lua_tag'
luasocket.c:(.text+0x354): undefined reference to `lua_tag'
luasocket.o: In function `global_callfromtable':
luasocket.c:(.text+0x480): undefined reference to `lua_tag'
luasocket.o: In function `push_clienttable':
luasocket.c:(.text+0x649): undefined reference to `lua_settag'
luasocket.c:(.text+0x662): undefined reference to `lua_settag'
luasocket.o: In function `global_udpsocket':
luasocket.c:(.text+0x196d): undefined reference to `lua_settag'
luasocket.c:(.text+0x1984): undefined reference to `lua_settag'
luasocket.o: In function `global_select':
luasocket.c:(.text+0x21e0): undefined reference to `lua_getn'
luasocket.c:(.text+0x2251): undefined reference to `lua_getn'
luasocket.c:(.text+0x23a9): undefined reference to `lua_tag'
luasocket.c:(.text+0x2494): undefined reference to `lua_tag'
luasocket.c:(.text+0x2588): undefined reference to `lua_getn'
luasocket.o: In function `global_tcpbind':
luasocket.c:(.text+0x31e4): undefined reference to `lua_settag'
luasocket.c:(.text+0x31fe): undefined reference to `lua_settag'
luasocket.c:(.text+0x32d1): undefined reference to `lua_pushuserdata'


Thanks in advance.
Australia #1
Ok, i have worked out that lua_settag, luaL_openl, lua_newtag, and lua_settagmethod. were all part of lua4 and have been replaced with metatables and metamethods in Lua 5.

Question is, i really don't know anything about any of this and what the new functions are and how much work its going to be to change the code to work with lua5.

Any assistance is always welcome,

Thanks in advance,

EDIT: i have done away with the local old version of luasockets and have linked against v5 instead, but i still have a few calls to the above mentioned functions in other sections of the code that need to be replaced.


muwlib.c:(.text+0x16): undefined reference to `luaL_openl'
Amended on Sun 06 Jul 2008 06:14 AM by Robert Powell
Australia #2
Ok, i have installed a local version of lua4 to try and get this thing working.

I now have this error when trying to start the server:

error: attempt to call global `lsdir' (a nil value)
stack traceback:
1: function `dofiles' at line 183 [file `support.lua']
2: main of file `muw.lua' at line 13


-- dofile() on files in a given directory
function dofiles(dir)
  -- get the list of files
  local files = lsdir(dir)
  -- do each file
  for i = 1, files.n do
    dofile(dir.."/"..files)
  end
end


After a bit of googeling i found an lsdir bash script, i just dont know if thats what its asking for, or am i missing something else.
Australia #3
Ok now i have gathered that these are calls to os functions,


07.06.03.59) error: attempt to call global `time' (a nil value)
stack traceback:
   1:  main of file `muw.lua' at line 56

randomseed(time())
boottime = time()


Trouble is that it will not make the calls, i tryed os.time and got the same error.

Im lost now.

Thanks in advance.
USA #4
Have you tried the newest version of LuaSockets? 2.0.2 is available http://www.tecgraf.puc-rio.br/~diego/professional/luasocket/
and built using Lua 5.1
Australia #5
Yeah i have tried that, the trouble is that lune was made using lua4 and things have changed so much since them that no longer exist in lua5x. I think i may have found the reason why i cannot call os functions and it may have something to do with matching the right gcc with the version of lua.

On my machine i have gcc4.2 but from the things i have read on various forums about this issue, the only way for these things to work right is to compile lua4 with gcc3.3. I don't really understand much of it, so i might just can trying to get lune to run for now, until i can find another box that i can put some archaic OS from 2001 on to it.

I find this sort of thing rather frustrating as i do not really possess the skill to take old code and make it work with modern compilers.
Amended on Sun 06 Jul 2008 11:19 PM by Robert Powell
USA #6
Where can you get the latest version of Lune? I would like to take a look at it.
Australia #7
You can find it at this link:

http://sourceforge.net/projects/lune/