ok, my bad.
I started http://www.gammon.com.au/forum/?id=10952.
I did not notice any missing include file, but I'll check it again. For instance, do you know where the luaC_function is declared ?
Amended on Mon 21 Feb 2011 10:19 PM (UTC) by Aiseant
Message
Well, I'll require a little more help, since I have the same kind of troubles and your answers didn't do any good in my case.
I'm also trying to put Lua in a C based mud, and got a bunch of things like :
"In file included from lua.h:17,
from lauxlib.c:23:
lauxlib.h:37: error: expected specifier-qualifier-list before
or kinda
warning: implicit declaration of function luaL_optlstring
To me, it sounds like a problem with the link with liblua.a, but i'm not sure.
I included lua.h (5.1.4), currently including luaconf.h lauxlib.h and lualib.h, a makefile with L_FLAGS = $(PROF) liblua.a -lm and $(CC) $(L_FLAGS) -o ../../blabla/bin/swr $(O_FILES) $(L_FLAGS) -lm -lcrypt
Ahh excellent. Yet again stumped by something so simple. I had read just before there actually that could be the cause of it. Typical. Thank you anyway Nick, as always your a great help!
Amended on Fri 22 Jan 2010 12:17 AM (UTC) by Nick Gammon
Message
OK I'll take a quick look. Send your details to me - mentioning where to look for compiling/linking the MUD. You can set up a temporary username/password for a day or so.
The symbols you are missing seem to be in liblua.a:
$ nm liblua.a
...
000014d0 T lua_gettable
000001c0 T lua_gettop
00000750 T lua_getupvalue
00000060 R lua_ident
00000280 T lua_insert
00000360 T lua_iscfunction
00001750 T lua_isnumber
00000390 T lua_isstring
000003c0 T lua_isuserdata
00001790 T lua_lessthan
00000d10 T lua_load
00001a10 T lua_newthread
...
I found liblua.a in the src directory after doing a "make" from the Lua source.
Where would I get that from Nick? I've checked my Lua folders for it and couldn't see it (It's not mentioned in the Lua makefile either). Also why would I require that? Am I missing something important?
I have lua installed on a modifed 1.4a base on my local Cygwin running machine and it works brilliantly. I'm now moving it over to my hosting provider and they have installed Lua for me to use. (Lua command outputs: Lua 5.1.3 Copyright (C) 1994-2008 Lua.org, PUC-Rio)
I have all the needed .h files (lua.h, luaconf.h, lualib.h and lauxlib.h) and liblua.a installed locally within the src folder.
All the defines for the files within the lua*.c files are set as
Here's the paths for the files (Remember, I have copies of these in the src also).
lauxlib.h, lua.h, luaconf.h, lualib.h are all located in /usr/local/include/
liblua.a is located in /usr/local/lib/
Now the problem is this. Upon compiling it goes all the way through to this stage and then dumps a lot of errors. Now as I recall this is a linking error and I can't for the life of me figure out what the problem is.
gcc liblua.a -lm -o dwc act_comm.o act_info.o
act_move.o act_obj.o act_wiz.o ban.o boards.o build.o
clans.o color.o comm.o comments.o const.o db.o deity.o
dwc.o editor.o fight.o grub.o handler.o hashstr.o house.o
ibuild.o ident.o imm_host.o interp.o lua_bits.o
lua_scripting.o lua_tables.o magic.o makeobjs.o mapout.o
misc.o mpxset.o mud_comm.o mud_prog.o mt19937ar.o
new_auth.o overland.o planes.o player.o polymorph.o
requests.o reset.o save.o services.o sha256.o shops.o
skills.o smithing.o special.o stat_obj.o tables.o track.o
update.o
lua_scripting.o: In function `L_find_room':
/home/talairina/src/lua_scripting.c:137: undefined reference to `lua_isnumber'
/home/talairina/src/lua_scripting.c:139: undefined reference to `luaL_checknumber'
/home/talairina/src/lua_scripting.c:141: undefined reference to `luaL_error'
lua_scripting.o: In function `L_find_character':
/home/talairina/src/lua_scripting.c:180: undefined reference to `lua_type'
/home/talairina/src/lua_scripting.c:181: undefined reference to `lua_type'
/home/talairina/src/lua_scripting.c:186: undefined reference to `luaL_checkudata'
/home/talairina/src/lua_scripting.c:204: undefined reference to `luaL_error'
/home/talairina/src/lua_scripting.c:212: undefined reference to `lua_toboolean'
/home/talairina/src/lua_scripting.c:225: undefined reference to `luaL_checknumber'
/home/talairina/src/lua_scripting.c:238: undefined reference to `luaL_error'
/home/talairina/src/lua_scripting.c:251: undefined reference to `lua_toboolean'
/home/talairina/src/lua_scripting.c:268: undefined reference to `luaL_optlstring'
It does go on and on. I've tried various way's to link the files but I can't seem to wrap my head around it. Any ideas?
The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).
To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.