Compiling with Cygwin

Posted by Norx on Sat 18 May 2002 04:04 AM — 6 posts, 20,432 views.

#0
I keep getting this error when I try to compile this code.


Administrator@HPSERVER ~
$ cd c:/aowsrc

Administrator@HPSERVER c:/aowsrc
$ make
gcc -c -Wall -D_AOW_CODER -O -g -DNOCRYPT -DOLD_RAND act_comm.c
gcc -c -Wall -D_AOW_CODER -O -g -DNOCRYPT -DOLD_RAND act_enter.c
gcc -c -Wall -D_AOW_CODER -O -g -DNOCRYPT -DOLD_RAND act_info.c
act_info.c: In function `show_char_to_char_0':
act_info.c:521: warning: suggest explicit braces to avoid ambiguous `else'
act_info.c: In function `do_look':
act_info.c:1482: warning: suggest explicit braces to avoid ambiguous `else'
act_info.c:1490: warning: suggest explicit braces to avoid ambiguous `else'
act_info.c: In function `do_who':
act_info.c:3726: warning: suggest explicit braces to avoid ambiguous `else'
act_info.c:3732: warning: suggest explicit braces to avoid ambiguous `else'
act_info.c:3738: warning: suggest explicit braces to avoid ambiguous `else'
act_info.c: In function `do_consider':
act_info.c:4017: warning: type defaults to `int' in declaration of `xp_compute'
gcc -c -Wall -D_AOW_CODER -O -g -DNOCRYPT -DOLD_RAND act_move.c
gcc -c -Wall -D_AOW_CODER -O -g -DNOCRYPT -DOLD_RAND act_obj.c
act_obj.c: In function `do_put':
act_obj.c:494: warning: suggest explicit braces to avoid ambiguous `else'
act_obj.c:526: warning: suggest explicit braces to avoid ambiguous `else'
act_obj.c: In function `get_cost':
act_obj.c:2232: warning: suggest explicit braces to avoid ambiguous `else'
act_obj.c: In function `do_list':
act_obj.c:2645: warning: suggest explicit braces to avoid ambiguous `else'
gcc -c -Wall -D_AOW_CODER -O -g -DNOCRYPT -DOLD_RAND act_wiz.c
gcc -c -Wall -D_AOW_CODER -O -g -DNOCRYPT -DOLD_RAND alias.c
gcc -c -Wall -D_AOW_CODER -O -g -DNOCRYPT -DOLD_RAND ban.c
gcc -c -Wall -D_AOW_CODER -O -g -DNOCRYPT -DOLD_RAND bit.c
gcc -c -Wall -D_AOW_CODER -O -g -DNOCRYPT -DOLD_RAND comm.c
comm.c:80: warning: `FNDELAY' redefined
/usr/include/sys/fcntl.h:81: warning: this is the location of the previous defin
ition
comm.c: In function `game_loop_unix':
comm.c:244: warning: unused variable `pattr'
comm.c:243: warning: unused variable `thread'
comm.c: In function `read_from_descriptor':
comm.c:601: warning: implicit declaration of function `read'
comm.c: In function `process_output':
comm.c:729: warning: suggest explicit braces to avoid ambiguous `else'
comm.c: In function `write_to_descriptor':
comm.c:1466: warning: implicit declaration of function `write'
gcc -c -Wall -D_AOW_CODER -O -g -DNOCRYPT -DOLD_RAND const.c
gcc -c -Wall -D_AOW_CODER -O -g -DNOCRYPT -DOLD_RAND db.c
db.c:49: conflicting types for `srandom'
/usr/include/stdlib.h:156: previous declaration of `srandom'
db.c: In function `load_topplayers':
db.c:430: warning: suggest explicit braces to avoid ambiguous `else'
db.c: In function `assign_area_vnum':
db.c:1017: warning: suggest explicit braces to avoid ambiguous `else'
db.c: In function `area_update':
db.c:1875: warning: unused variable `pRoomIndex'
make: *** [db.o] Error 1

Administrator@HPSERVER c:/aowsrc
$


Running Windows 2000, any help would be great.
#1
Forgot to mention I tried Nick said to do. Adding "-DNOCRYPT" and "-DOLD_RAND"


I still get the same message with or without adding that stuff.
#2
Here is what the original make file looks like.

CC = gcc
PROF = -O -g3
NOCRYPT =
C_FLAGS = -Wall -D_REENTRANT -D_AOW_CODER $(PROF) $(NOCRYPT)
L_FLAGS = -lcrypt -lpthread $(PROF)

O_FILES = \
act_comm.o act_enter.o act_info.o act_move.o act_obj.o \
act_wiz.o alias.o ban.o bit.o comm.o \
const.o db.o db2.o effects.o fight.o \
flags.o handler.o healer.o hunt.o illegal.o \
interp.o lookup.o magic.o magic2.o mem.o \
mob_cmds.o mob_prog.o mount.o music.o new_dump.o \
note.o olc.o olc_act.o olc_mpcode.o olc_save.o \
pchannels.o combat.o clouds.o \
quest.o recycle.o save.o scan.o signals.o \
skills.o special.o string.o tables.o update.o

C_FILES = \
act_comm.c act_enter.c act_info.c act_move.c act_obj.c \
act_wiz.c alias.c ban.c bit.c comm.c \
const.c db.c db2.c effects.c fight.c \
flags.c handler.c healer.c hunt.c illegal.c \
interp.c lookup.c magic.c magic2.c mem.c \
mob_cmds.c mob_prog.c mount.c music.c new_dump.c \
note.c olc.c olc_act.c olc_mpcode.c olc_save.c \
pchannels.c combat.c clouds.c \
quest.c recycle.c save.c scan.c signals.c \
skills.c special.c string.c tables.c update.c \
cgi/aowutils.c cgi/cgiutils.c cgi/class.c cgi/library.c \
cgi/race.c cgi/raceclass.c cgi/warscore.c

H_FILES = \
db.h interp.h lookup.h magic.h merc.h mob_cmds.h \
music.h olc.h recycle.h tables.h telnet.h \
cgi/aowutils.h cgi/cgiutils.h

M_FILES = Makefile cgi/Makefile

PL_FILE = mudcheck.pl pfc.pl

aow_coder: $(O_FILES)
rm -f aow_coder
$(CC) $(L_FLAGS) -o aow_coder $(O_FILES)

backup:
tar cf - $(C_FILES) $(H_FILES) $(M_FILES) $(PL_FILE) | gzip -9 >../src.tgz

clean:
rm *.o

.c.o: merc.h
$(CC) -c $(C_FLAGS) $<
Australia Forum Administrator #3
Exactly which ROM file did you compile?
#4
Its some code for a mud I play. The admin gave me the source code for it so I can play with it. He runs it under linux and was wondering if there was a way to run it under windows. Its his code, a modified version of rom 2.4
Australia Forum Administrator #5
I couldn't see an error message there, only warnings. It is hard to say for sure, but under Cygwin you should be able to do it.

I don't really have time to download and work out how to compile every bit of modified code. Try looking at the messages carefully, and search this forum for keywords based on the error message.