Compiling ROM 2.4b6OLC with Cygwin

Posted by Mrjones on Wed 02 May 2001 02:08 AM — 4 posts, 17,948 views.

#0
I have the latest version of cygwin and rom source. I unpack it into a directory, then fire up a command prompt and do a make with mt fingers and eyes crossed.....

gcc -c -Wall -O -g -DNOCRYPT -DOLD_RAND act_comm.c
.
.
.
.
.
gcc -c -Wall -O -g -DNOCRYPT -DOLD_RAND special.c
special.c: In function `spec_string':
special.c:1037: subscripted value is neither array nor pointer
make: *** [special.o] Error 1

ouch. I am a VB programmer who is learning C and this error makes no sense. Its a new function for OLC and it looks like a pointer but I dont see an error. Here is my makefile if it helps.

CC = gcc
PROF = -O -g
NOCRYPT = -DNOCRYPT
C_FLAGS = -Wall $(PROF) $(NOCRYPT) -DOLD_RAND
L_FLAGS = $(PROF)
LIBS = -lcrypt

O_FILES = act_comm.o act_enter.o act_info.o act_move.o act_obj.o act_wiz.o \
alias.o ban.o comm.o const.o db.o db2.o effects.o fight.o flags.o \
handler.o healer.o interp.o note.o lookup.o magic.o magic2.o \
music.o recycle.o save.o scan.o skills.o special.o tables.o \
update.o NewMagic.o act_newc.o remort.o bank.o

rom: $(O_FILES)
rm -f rom
$(CC) $(L_FLAGS) -o rom $(O_FILES) $(LIBS)

.c.o: merc.h
$(CC) -c $(C_FLAGS) $<


Thanks alot. You rock

-Bannon
Australia Forum Administrator #1
When you say the "latest" ROM source, that can mean different things to different people. Latest on what server, for instance?

Can you please specify the exact version number of ROM you are compiling, the exact name of the file you downloaded (the .gz or similar file) and where you got it.

Then I can try that particular version. I didn't get that error compiling "standard" ROM, so I think the version you have got will make the difference.

I think I compiled 2.4 b2 and 2.4 b6, but I'm not absolutely sure which one compiled OK, or whether both did.
#2
Sorry. The title of the post was the filename, but i didnt put on the extension...

Filename: Rom24b6OLC.tar.gz
location: http://www.smaug.org/cgi-bin/directory?/pub/mud/diku/merc/rom

I was able to patch the r24b4 version with ivans olc 171, but whenever I tried saving my immort character the mud crashed :) so I figured I's try the pre-patched version above.


thnx again
Amended on Tue 20 Nov 2007 04:19 AM by Nick Gammon
Australia Forum Administrator #3
My apologies. By the time I had scrolled down to read your message the subject had vanished off the screen and I didn't notice the version number. :)

I got it to compile and link with two changes:

In special.c at line 1037, change:


for ( cmd = 0; spec_table[cmd].function[0] != '\0'; cmd++ )


to:


for ( cmd = 0; spec_table[cmd].function; cmd++ )



In olc_act.c at line 199, change:


for (spec = 0; spec_table[spec].function[0] != '\0'; spec++)


to:


for (spec = 0; spec_table[spec].function; spec++)