10 Jan, 2010, jurdendurden wrote in the 1st comment:
Votes: 0
After the initial setup I'm trying to compile and getting a slew of errors, here is a portion:

Andrew@Andrew-PC /cygdrive/d/mud/quickmud/src
$ make
gcc -O -g3 -Wall -DIMC -DIMCROM -c -o obj/lua_scripting.o lua_scripting.c
In file included from /usr/local/include/lualib.h:11,
from lua_scripting.c:22:
/usr/local/include/lua.h:45: error: parse error before numeric constant
/usr/local/include/lua.h:51: error: parse error before numeric constant
/usr/local/include/lua.h:53: error: parse error before numeric constant
/usr/local/include/lua.h:103: error: parse error before numeric constant
/usr/local/include/lua.h:104: error: parse error before numeric constant
/usr/local/include/lua.h:106: error: parse error before numeric constant
/usr/local/include/lua.h:112: error: parse error before numeric constant
/usr/local/include/lua.h:113: error: parse error before numeric constant
/usr/local/include/lua.h:114: error: parse error before numeric constant
/usr/local/include/lua.h:115: error: parse error before numeric constant
/usr/local/include/lua.h:116: error: parse error before numeric constant
/usr/local/include/lua.h:117: error: parse error before numeric constant
/usr/local/include/lua.h:118: error: parse error before numeric constant
/usr/local/include/lua.h:127: error: parse error before numeric constant
/usr/local/include/lua.h:128: error: parse error before numeric constant
/usr/local/include/lua.h:129: error: parse error before numeric constant
/usr/local/include/lua.h:130: error: parse error before numeric constant
/usr/local/include/lua.h:131: error: parse error before numeric constant
/usr/local/include/lua.h:132: error: parse error before numeric constant
/usr/local/include/lua.h:134: error: parse error before numeric constant
/usr/local/include/lua.h:135: error: parse error before numeric constant
/usr/local/include/lua.h:136: error: parse error before numeric constant
/usr/local/include/lua.h:138: error: parse error before numeric constant
/usr/local/include/lua.h:139: error: parse error before numeric constant
/usr/local/include/lua.h:140: error: parse error before numeric constant
/usr/local/include/lua.h:141: error: parse error before numeric constant
/usr/local/include/lua.h:142: error: parse error before numeric constant
/usr/local/include/lua.h:143: error: parse error before numeric constant
/usr/local/include/lua.h:144: error: parse error before numeric constant
/usr/local/include/lua.h:145: error: parse error before numeric constant
/usr/local/include/lua.h:151: error: parse error before numeric constant
/usr/local/include/lua.h:152: error: parse error before numeric constant
/usr/local/include/lua.h:153: error: parse error before numeric constant
/usr/local/include/lua.h:154: error: parse error before numeric constant
/usr/local/include/lua.h:155: error: parse error before numeric constant
/usr/local/include/lua.h:157: error: parse error before numeric constant
/usr/local/include/lua.h:158: error: parse error before numeric constant
/usr/local/include/lua.h:159: error: parse error before numeric constant
/usr/local/include/lua.h:160: error: parse error before numeric constant
/usr/local/include/lua.h:166: error: parse error before numeric constant
/usr/local/include/lua.h:167: error: parse error before numeric constant
/usr/local/include/lua.h:168: error: parse error before numeric constant
/usr/local/include/lua.h:169: error: parse error before numeric constant
/usr/local/include/lua.h:170: error: parse error before numeric constant
/usr/local/include/lua.h:171: error: parse error before numeric constant
/usr/local/include/lua.h:172: error: parse error before numeric constant
/usr/local/include/lua.h:178: error: parse error before numeric constant
/usr/local/include/lua.h:179: error: parse error before numeric constant
/usr/local/include/lua.h:180: error: parse error before numeric constant
/usr/local/include/lua.h:181: error: parse error before numeric constant
/usr/local/include/lua.h:182: error: parse error before numeric constant
/usr/local/include/lua.h:188: error: parse error before numeric constant
/usr/local/include/lua.h:189: error: parse error before numeric constant
/usr/local/include/lua.h:190: error: parse error before numeric constant
/usr/local/include/lua.h:191: error: parse error before numeric constant
/usr/local/include/lua.h:194: error: parse error before numeric constant
/usr/local/include/lua.h:200: error: parse error before numeric constant
/usr/local/include/lua.h:201: error: parse error before numeric constant
/usr/local/include/lua.h:206: error: parse error before numeric constant
/usr/local/include/lua.h:207: error: parse error before numeric constant
/usr/local/include/lua.h:208: error: parse error before numeric constant
/usr/local/include/lua.h:216: error: parse error before numeric constant
/usr/local/include/lua.h:218: error: parse error before numeric constant
/usr/local/include/lua.h:220: error: parse error before numeric constant
/usr/local/include/lua.h:262: error: parse error before numeric constant
/usr/local/include/lua.h:332: error: parse error before numeric constant
/usr/local/include/lua.h:335: error: parse error before numeric constant
/usr/local/include/lua.h:336: error: parse error before numeric constant
/usr/local/include/lua.h:337: error: parse error before numeric constant
/usr/local/include/lua.h:338: error: parse error before numeric constant
/usr/local/include/lua.h:339: error: parse error before numeric constant
/usr/local/include/lua.h:340: error: parse error before numeric constant
/usr/local/include/lua.h:342: error: parse error before numeric constant
/usr/local/include/lua.h:343: error: parse error before numeric constant
/usr/local/include/lua.h:344: error: parse error before numeric constant
/usr/local/include/lua.h:345: error: parse error before numeric constant
In file included from lua_scripting.c:22:
/usr/local/include/lualib.h:20: error: parse error before numeric constant
/usr/local/include/lualib.h:23: error: parse error before numeric constant
/usr/local/include/lualib.h:27: error: parse error before numeric constant
/usr/local/include/lualib.h:30: error: parse error before numeric constant
/usr/local/include/lualib.h:33: error: parse error before numeric constant
/usr/local/include/lualib.h:36: error: parse error before numeric constant
/usr/local/include/lualib.h:39: error: parse error before numeric constant
In file included from lua_scripting.c:23:
/usr/local/include/lauxlib.h:30: error: parse error before numeric constant
/usr/local/include/lauxlib.h:32: error: parse error before numeric constant
/usr/local/include/lauxlib.h:33: error: parse error before numeric constant
/usr/local/include/lauxlib.h:34: error: parse error before numeric constant
/usr/local/include/lauxlib.h:35: error: parse error before numeric constant
/usr/local/include/lauxlib.h:36: error: parse error before numeric constant
/usr/local/include/lauxlib.h:37: error: parse error before numeric constant
/usr/local/include/lauxlib.h:39: error: parse error before numeric constant
/usr/local/include/lauxlib.h:40: error: parse error before numeric constant
/usr/local/include/lauxlib.h:42: error: parse error before numeric constant
/usr/local/include/lauxlib.h:43: error: parse error before numeric constant
/usr/local/include/lauxlib.h:44: error: parse error before numeric constant
/usr/local/include/lauxlib.h:46: error: parse error before numeric constant
/usr/local/include/lauxlib.h:47: error: parse error before numeric constant
/usr/local/include/lauxlib.h:48: error: parse error before numeric constant
/usr/local/include/lauxlib.h:50: error: parse error before numeric constant
/usr/local/include/lauxlib.h:51: error: parse error before numeric constant
/usr/local/include/lauxlib.h:55: error: parse error before numeric constant
/usr/local/include/lauxlib.h:56: error: parse error before numeric constant
/usr/local/include/lauxlib.h:58: error: parse error before numeric constant
/usr/local/include/lauxlib.h:59: error: parse error before numeric constant
/usr/local/include/lauxlib.h:61: error: parse error before numeric constant
/usr/local/include/lauxlib.h:62: error: parse error before numeric constant
/usr/local/include/lauxlib.h:98: error: parse error before numeric constant
/usr/local/include/lauxlib.h:100: error: parse error before '}' token
/usr/local/include/lauxlib.h:108: error: parse error before numeric constant
/usr/local/include/lauxlib.h:109: error: parse error before '*' token
/usr/local/include/lauxlib.h:110: error: parse error before '*' token
/usr/local/include/lauxlib.h:111: error: parse error before '*' token
/usr/local/include/lauxlib.h:112: error: parse error before '*' token
/usr/local/include/lauxlib.h:113: error: parse error before '*' token
/usr/local/include/lauxlib.h:124: error: parse error before numeric constant
/usr/local/include/lauxlib.h:125: error: parse error before numeric constant
/usr/local/include/lauxlib.h:126: error: parse error before numeric constant
lua_scripting.c:29: error: parse error before numeric constant
lua_scripting.c:49: error: parse error before numeric constant
lua_scripting.c: In function `check_vnum':
lua_scripting.c:53: error: `MAX_VNUM' undeclared (first use in this function)
lua_scripting.c:53: error: (Each undeclared identifier is reported only once
lua_scripting.c:53: error: for each function it appears in.)
lua_scripting.c: At top level:
lua_scripting.c:62: error: parse error before numeric constant
lua_scripting.c: In function `L_getchar':
lua_scripting.c:70: error: `LUA_ENVIRONINDEX' undeclared (first use in this func
tion)
lua_scripting.c: At top level:
lua_scripting.c:79: error: parse error before numeric constant
lua_scripting.c: In function `L_find_character':
lua_scripting.c:91: error: structure has no member named `first_person'
lua_scripting.c:102: error: `first_char' undeclared (first use in this function)

lua_scripting.c: At top level:
lua_scripting.c:115: error: parse error before numeric constant
lua_scripting.c:141: error: parse error before numeric constant
lua_scripting.c: In function `CallLuaWithTraceBack':
lua_scripting.c:145: error: `iArguments' undeclared (first use in this function)

lua_scripting.c:150: error: `iReturn' undeclared (first use in this function)
lua_scripting.c: At top level:
lua_scripting.c:169: error: parse error before numeric constant
lua_scripting.c: In function `L_system_info':
lua_scripting.c:172: warning: implicit declaration of function `lua_setfield'
lua_scripting.c:186: error: `LUA_DIR' undeclared (first use in this function)
lua_scripting.c:224: error: `LUA_STARTUP' undeclared (first use in this function
)
lua_scripting.c: At top level:
lua_scripting.c:250: error: parse error before numeric constant
lua_scripting.c:412: error: parse error before numeric constant
lua_scripting.c:414: error: parse error before numeric constant
lua_scripting.c: In function `add_object_item':
lua_scripting.c:419: error: `obj' undeclared (first use in this function)
lua_scripting.c:458: error: `item' undeclared (first use in this function)
lua_scripting.c: At top level:
lua_scripting.c:465: error: parse error before numeric constant
lua_scripting.c: In function `build_inventory':
lua_scripting.c:469: error: `obj' undeclared (first use in this function)
lua_scripting.c: At top level:
lua_scripting.c:481: error: parse error before numeric constant
lua_scripting.c: In function `L_inventory':
lua_scripting.c:492: error: structure has no member named `first_carrying'
lua_scripting.c: At top level:
lua_scripting.c:497: error: parse error before numeric constant
lua_scripting.c: In function `L_equipped':
lua_scripting.c:508: error: structure has no member named `first_carrying'
lua_scripting.c: In function `check_inventory':
lua_scripting.c:528: error: structure has no member named `first_content'
lua_scripting.c:530: error: structure has no member named `first_content'
lua_scripting.c: At top level:
lua_scripting.c:542: error: parse error before numeric constant
lua_scripting.c: In function `L_carryingvnum':
lua_scripting.c:550: error: structure has no member named `first_carrying'
lua_scripting.c: At top level:
lua_scripting.c:557: error: parse error before numeric constant
lua_scripting.c: In function `L_wearing':
lua_scripting.c:566: error: `item_w_flags' undeclared (first use in this functio
n)
lua_scripting.c:572: error: structure has no member named `first_carrying'
lua_scripting.c: At top level:
lua_scripting.c:587: error: parse error before numeric constant
lua_scripting.c: In function `L_wearingvnum':
lua_scripting.c:595: error: structure has no member named `first_carrying'
lua_scripting.c: At top level:
lua_scripting.c:622: error: parse error before numeric constant
lua_scripting.c:688: error: parse error before numeric constant
lua_scripting.c:730: error: parse error before numeric constant
lua_scripting.c:765: error: parse error before numeric constant
lua_scripting.c: In function `L_room_info':
lua_scripting.c:799: error: structure has no member named `first_exit'
lua_scripting.c:814: error: structure has no member named `vdir'
lua_scripting.c: At top level:
lua_scripting.c:821: error: parse error before numeric constant
lua_scripting.c:827: error: parse error before numeric constant
lua_scripting.c:837: error: parse error before numeric constant
lua_scripting.c:843: error: parse error before numeric constant
lua_scripting.c: In function `L_oinvoke':
lua_scripting.c:863: error: void value not ignored as it ought to be
lua_scripting.c:867: error: void value not ignored as it ought to be
lua_scripting.c: At top level:
lua_scripting.c:874: error: parse error before numeric constant
lua_scripting.c:891: error: parse error before numeric constant
lua_scripting.c: In function `L_mobinarea':
lua_scripting.c:906: error: `first_char' undeclared (first use in this function)

lua_scripting.c: At top level:
lua_scripting.c:923: error: parse error before numeric constant
lua_scripting.c: In function `L_mobinroom':
lua_scripting.c:931: error: structure has no member named `first_person'
lua_scripting.c: At top level:
lua_scripting.c:944: error: parse error before numeric constant
lua_scripting.c: In function `L_players_in_room':
lua_scripting.c:961: error: structure has no member named `first_person'
lua_scripting.c: At top level:
lua_scripting.c:972: error: parse error before numeric constant
lua_scripting.c: In function `L_players_in_game':
lua_scripting.c:982: error: `first_char' undeclared (first use in this function)

lua_scripting.c: At top level:
lua_scripting.c:993: error: parse error before numeric constant
lua_scripting.c: In function `L_mobs_in_room':
lua_scripting.c:1010: error: structure has no member named `first_person'
lua_scripting.c: At top level:
lua_scripting.c:1056: error: parse error before numeric constant
lua_scripting.c: In function `RegisterLuaRoutines':
lua_scripting.c:1060: error: `LUA_ENVIRONINDEX' undeclared (first use in this fu
nction)
lua_scripting.c:1066: warning: implicit declaration of function `luaL_register'
lua_scripting.c: In function `open_lua':
lua_scripting.c:1080: error: parse error before numeric constant
lua_scripting.c:1081: error: parse error before numeric constant
lua_scripting.c:1083: error: parse error before numeric constant
lua_scripting.c: At top level:
lua_scripting.c:1089: error: parse error before numeric constant
lua_scripting.c:1089: warning: type defaults to `int' in declaration of `luaL_op
enlibs'
lua_scripting.c:1089: warning: data definition has no type or storage class
lua_scripting.c:1092: error: parse error before numeric constant
lua_scripting.c:1092: warning: type defaults to `int' in declaration of `lua_pus
hcclosure'
lua_scripting.c:1092: error: conflicting types for 'lua_pushcclosure'
/usr/local/include/lua.h:158: error: previous declaration of 'lua_pushcclosure'
was here
lua_scripting.c:1092: error: conflicting types for 'lua_pushcclosure'
/usr/local/include/lua.h:158: error: previous declaration of 'lua_pushcclosure'
was here
lua_scripting.c:1092: warning: data definition has no type or storage class
lua_scripting.c:1093: error: parse error before numeric constant
lua_scripting.c:1093: warning: type defaults to `int' in declaration of `lua_pus
hstring'
lua_scripting.c:1093: error: conflicting types for 'lua_pushstring'
/usr/local/include/lua.h:154: error: previous declaration of 'lua_pushstring' wa
s here
lua_scripting.c:1093: error: conflicting types for 'lua_pushstring'
/usr/local/include/lua.h:154: error: previous declaration of 'lua_pushstring' wa
s here
lua_scripting.c:1093: warning: data definition has no type or storage class
lua_scripting.c:1094: error: parse error before numeric constant
lua_scripting.c:1095: error: parse error before numeric constant
lua_scripting.c:1095: warning: type defaults to `int' in declaration of `lua_cal
l'
lua_scripting.c:1095: error: conflicting types for 'lua_call'
/usr/local/include/lua.h:188: error: previous declaration of 'lua_call' was here

lua_scripting.c:1095: error: conflicting types for 'lua_call'
/usr/local/include/lua.h:188: error: previous declaration of 'lua_call' was here

lua_scripting.c:1095: warning: data definition has no type or storage class
lua_scripting.c:1103: error: parse error before '(' token
lua_scripting.c:1109: error: parse error before string constant
lua_scripting.c:1110: warning: type defaults to `int' in declaration of `ch_prin
tf'
lua_scripting.c:1110: warning: data definition has no type or storage class
lua_scripting.c:1115: error: parse error before numeric constant
lua_scripting.c:1115: warning: type defaults to `int' in declaration of `lua_set
top'
lua_scripting.c:1115: error: conflicting types for 'lua_settop'
/usr/local/include/lua.h:113: error: previous declaration of 'lua_settop' was he
re
lua_scripting.c:1115: error: conflicting types for 'lua_settop'
/usr/local/include/lua.h:113: error: previous declaration of 'lua_settop' was he
re
lua_scripting.c:1115: warning: data definition has no type or storage class
lua_scripting.c: In function `close_lua':
lua_scripting.c:1122: error: parse error before numeric constant
lua_scripting.c:1125: error: parse error before numeric constant
lua_scripting.c:1126: error: parse error before numeric constant
lua_scripting.c: In function `find_lua_function':
lua_scripting.c:1132: error: parse error before numeric constant
lua_scripting.c:1147: warning: return makes pointer from integer without a cast
lua_scripting.c: At top level:
lua_scripting.c:1151: error: parse error before numeric constant
lua_scripting.c: In function `call_lua_function':
lua_scripting.c:1157: error: `nArgs' undeclared (first use in this function)
lua_scripting.c:1162: error: `fname' undeclared (first use in this function)
lua_scripting.c:1165: error: `ch' undeclared (first use in this function)
lua_scripting.c:1167: warning: implicit declaration of function `set_char_color'

lua_scripting.c:1167: error: `AT_YELLOW' undeclared (first use in this function)

lua_scripting.c: In function `call_lua':
lua_scripting.c:1184: error: parse error before numeric constant
lua_scripting.c: In function `call_lua_num':
lua_scripting.c:1202: error: parse error before numeric constant
lua_scripting.c: At top level:
lua_scripting.c:1057: warning: 'RegisterLuaRoutines' defined but not used
lua_scripting.c:1131: warning: 'find_lua_function' defined but not used
make: *** [obj/lua_scripting.o] Error 1

Andrew@Andrew-PC /cygdrive/d/mud/quickmud/src
$


The first error refers to line 45 in lua.h, which reads as follows:
typedef int (*lua_CFunction) (lua_State *L);


Is this the same problem that is mentioned when JohnnyStarr was implementing it into Merc 2.1? (as far as L being a macro in merc).
If not, anyone have any ideas?
10 Jan, 2010, jurdendurden wrote in the 2nd comment:
Votes: 0
Some by the way info I forgot to mention: This is running cygwin with QuickMUD (straight C, no C++), with LUA 5.0.2
10 Jan, 2010, elanthis wrote in the 3rd comment:
Votes: 0
I'd check the L thing. Try doing #undef L before including the lua.h file.
10 Jan, 2010, Twisol wrote in the 4th comment:
Votes: 0
That came to my mind too, but is it possible to re-def L afterwards? Otherwise, wouldn't the issue have just moved to the MUD itself with an undefined-symbol error?
10 Jan, 2010, Davion wrote in the 5th comment:
Votes: 0
It's definitely the L thing (as L is not a numerical constant until it's def'd in merc.h). Make sure you include lua.h -before- merc.h. That should help solve your problem. If you want though, you could always use like

#undef L
#include<lua.h>
#define L 1 << 12
10 Jan, 2010, David Haley wrote in the 6th comment:
Votes: 0
Or, include Lua before you #define L.

Also, by the way, it's "Lua", not "LUA".
10 Jan, 2010, jurdendurden wrote in the 7th comment:
Votes: 0
Yeah, just as I suspected, the 'L' thing :P Defining merc.h after Lua.h worked fine. Thanks, now on to the other 150 errors I'm getting ;)
10 Jan, 2010, jurdendurden wrote in the 8th comment:
Votes: 0
David Haley said:
Or, include Lua before you #define L.

Also, by the way, it's "Lua", not "LUA".


What's the diff? Other than it's not an Acronym (Lua means moon.)
10 Jan, 2010, quixadhal wrote in the 9th comment:
Votes: 0
jurdendurden said:
David Haley said:
Or, include Lua before you #define L.

Also, by the way, it's "Lua", not "LUA".


What's the diff? Other than it's not an Acronym (Lua means moon.)


You don't write proper nouns in all caps, or the ghost of the English Language will QQ all over you.
10 Jan, 2010, David Haley wrote in the 10th comment:
Votes: 0
jurdendurden said:
David Haley said:
Or, include Lua before you #define L.

Also, by the way, it's "Lua", not "LUA".


What's the diff? Other than it's not an Acronym (Lua means moon.)

Well, the difference is that it's not an acronym and it's written Lua… :wink: It's 'Python', not 'PYTHON', 'Ruby' not 'RUBY', 'jurdendurden' not 'JURDENDURDEN', etc. Not sure why so many people think it's 'LUA' because it's never written anything like that in any official source, distribution, website, etc.
10 Jan, 2010, Twisol wrote in the 11th comment:
Votes: 0
FORTRAN, COBOL, BASIC (though that one's debatable these days)… but those are all older languages. *shrug* Although they are acronyms.
10 Jan, 2010, JohnnyStarr wrote in the 12th comment:
Votes: 0
A lot of what you will come across is covered in this thread.
(including the issue you had with L)
I was originally using QuickMud, but switched to Merc2.1 for several reasons.
I'm really excited that our Lua community is growing!
18 Jan, 2010, Kjwah wrote in the 13th comment:
Votes: 0
Wow, so this was my problem when I was doing this a year(couple maybe?) ago… Not sure why it never hit me.
18 Jan, 2010, Mudder wrote in the 14th comment:
Votes: 0
JohnnyStarr said:
I'm really excited that our Lua community is growing!

Yeah. I'm still planning on using it. Hopefully you guys will have it all worked out and sexy by when I'm ready! :D
18 Jan, 2010, JohnnyStarr wrote in the 15th comment:
Votes: 0
Mudder said:
JohnnyStarr said:
I'm really excited that our Lua community is growing!

Yeah. I'm still planning on using it. Hopefully you guys will have it all worked out and sexy by when I'm ready! :D


Well, my gears have shifted a bit, so you may want to get a copy of what I have so far, because I might not finish it.
I'm going to go back to my Ruby project using EventMachine for awhile. I want to make a turn based combat system, and I'm
a bit too lazy to do it in Lua / C++. In other words, Ruby is just so dang easy to use! PM me if you want a copy of Lunacy, it would
probably take you 10 minutes to port it to ROM or RaM or whatever you are using ;)

EDIT: I would upload it, but it's a bit, err, incomplete ;)
But my license is open domain, so that might make it worth your while to at least use a reference.
19 Jan, 2010, JohnnyStarr wrote in the 16th comment:
Votes: 0
I got several requests today for Lunacy so here you go.
0.0/16