CYGWIN and compiling SWR

Posted by Calhoun4 on Mon 12 Aug 2002 04:03 AM — 16 posts, 64,963 views.

USA #0
I am trying so desperately hard to compile SWR1.0 with CYGWIN and I cannot suceed. I get the following. Someone help!

$ make all
make swreality
make[1]: Entering directory `/dist/src'
gcc -c -g3 -Wall act_comm.c
gcc -c -g3 -Wall act_info.c
act_info.c: In function `do_password':
act_info.c:2872: warning: implicit declaration of function `crypt'
act_info.c:2872: warning: passing arg 1 of `strcmp' makes pointer from integer w
ithout a cast
act_info.c:2889: warning: assignment makes pointer from integer without a cast
gcc -c -g3 -Wall act_move.c
gcc -c -g3 -Wall act_obj.c
act_obj.c: In function `can_layer':
act_obj.c:1107: warning: suggest explicit braces to avoid ambiguous `else'
act_obj.c: In function `do_auction':
act_obj.c:2324: warning: suggest explicit braces to avoid ambiguous `else'
act_obj.c:2348: warning: suggest explicit braces to avoid ambiguous `else'
gcc -c -g3 -Wall act_wiz.c
act_wiz.c:2355:22: warning: multi-line string literals are deprecated
act_wiz.c:2372:25: warning: multi-line string literals are deprecated
act_wiz.c:2376:26: warning: multi-line string literals are deprecated
act_wiz.c: In function `do_form_password':
act_wiz.c:4307: warning: implicit declaration of function `crypt'
gcc -c -g3 -Wall boards.c
gcc -c -g3 -Wall build.c
build.c: In function `do_goto':
build.c:882: warning: suggest explicit braces to avoid ambiguous `else'
build.c:898: warning: suggest explicit braces to avoid ambiguous `else'
build.c: In function `do_mset':
build.c:1563: warning: implicit declaration of function `crypt'
build.c:1563: warning: assignment makes pointer from integer without a cast
gcc -c -g3 -Wall clans.c
clans.c:2497:3: warning: no newline at end of file
gcc -c -g3 -Wall comm.c
comm.c: In function `nanny':
comm.c:1486: warning: implicit declaration of function `crypt'
comm.c:1486: warning: passing arg 1 of `strcmp' makes pointer from integer witho
ut a cast
comm.c:1575: warning: assignment makes pointer from integer without a cast
comm.c:1596: warning: passing arg 1 of `strcmp' makes pointer from integer witho
ut a cast
gcc -c -g3 -Wall comments.c
gcc -c -g3 -Wall const.c
gcc -c -g3 -Wall db.c
db.c: In function `load_resets':
db.c:1472: warning: suggest explicit braces to avoid ambiguous `else'
gcc -c -g3 -Wall fight.c
gcc -c -g3 -Wall handler.c
handler.c: In function `get_eq_char':
handler.c:1208: warning: suggest explicit braces to avoid ambiguous `else'
handler.c: In function `extract_char':
handler.c:1660: warning: suggest explicit braces to avoid ambiguous `else'
handler.c: At top level:
handler.c:2941: warning: type defaults to `int' in declaration of `top_reset'
gcc -c -g3 -Wall hashstr.c
gcc -c -g3 -Wall id.c
gcc -c -g3 -Wall interp.c
gcc -c -g3 -Wall magic.c
magic.c: In function `process_spell_components':
magic.c:727: warning: suggest explicit braces to avoid ambiguous `else'
magic.c:745: warning: suggest explicit braces to avoid ambiguous `else'
gcc -c -g3 -Wall makeobjs.c
gcc -c -g3 -Wall misc.c
misc.c: In function `do_hail':
misc.c:2449: warning: suggest explicit braces to avoid ambiguous `else'
misc.c: In function `do_suicide':
misc.c:2705: warning: implicit declaration of function `crypt'
misc.c:2705: warning: passing arg 1 of `strcmp' makes pointer from integer witho
ut a cast
misc.c:2803:2: warning: no newline at end of file
gcc -c -g3 -Wall mud_comm.c
gcc -c -g3 -Wall mud_prog.c
gcc -c -g3 -Wall player.c
player.c:380:18: warning: trigraph ??) ignored
gcc -c -g3 -Wall requests.c
gcc -c -g3 -Wall reset.c
gcc -c -g3 -Wall save.c
save.c: In function `load_char_obj':
save.c:913: warning: suggest explicit braces to avoid ambiguous `else'
save.c: In function `load_corpses':
save.c:2055: warning: assignment from incompatible pointer type
save.c:2057: dereferencing pointer to incomplete type
save.c:2059: dereferencing pointer to incomplete type
make[1]: *** [save.o] Error 1
make[1]: Leaving directory `/dist/src'
make: *** [all] Error 2
Australia Forum Administrator #1
Quote:

player.c:380:18: warning: trigraph ??) ignored


Trigraph? That seems strange. Check the source file (player.c) at line 380. Maybe you need to convert from Unix to DOS line-ends or vice-versa.
#2
I'm also haveing problems compiling the server. I'm using Cygwin and compiling ported SWR 1.0 under windows. I compiled the first time and got a bunch of warnings and the usual (dunno) and then did it again and here's what I got

make swreality
make[1]: Entering directory `/cygdrive/c/dist/swr10/src'
gcc -c -g3 -Wall comm.c
In file included from comm.c:33:
mud.h:4973: warning: `/*' within comment
In file included from comm.c:62:
/usr/include/netinet/ip.h:167: parse error before `n_long'
/usr/include/netinet/ip.h:167: warning: no semicolon at end of struct or union
/usr/include/netinet/ip.h:167: warning: no semicolon at end of struct or union
/usr/include/netinet/ip.h:170: parse error before `n_long'
/usr/include/netinet/ip.h:170: warning: no semicolon at end of struct or union
/usr/include/netinet/ip.h:171: warning: data definition has no type or storage c
lass
/usr/include/netinet/ip.h:172: parse error before `}'
/usr/include/netinet/ip.h:172: warning: data definition has no type or storage c
lass
/usr/include/netinet/ip.h:173: parse error before `}'
comm.c: In function `new_descriptor':
comm.c:867: warning: implicit declaration of function `save_sysdata'
make[1]: *** [comm.o] Error 1
make[1]: Leaving directory `/cygdrive/c/dist/swr10/src'
make: *** [all] Error 2
#3
Here's what I get the first time:

$ make
make swreality
make[1]: Entering directory `/cygdrive/c/dist/swr10/src'
gcc -c -g3 -Wall act_comm.c
In file included from act_comm.c:27:
mud.h:4973: warning: `/*' within comment
gcc -c -g3 -Wall act_info.c
In file included from act_info.c:27:
mud.h:4973: warning: `/*' within comment
gcc -c -g3 -Wall act_move.c
In file included from act_move.c:27:
mud.h:4973: warning: `/*' within comment
gcc -c -g3 -Wall act_obj.c
In file included from act_obj.c:25:
mud.h:4973: warning: `/*' within comment
act_obj.c: In function `can_layer':
act_obj.c:1107: warning: suggest explicit braces to avoid ambiguous `else'
act_obj.c: In function `do_auction':
act_obj.c:2324: warning: suggest explicit braces to avoid ambiguous `else'
act_obj.c:2348: warning: suggest explicit braces to avoid ambiguous `else'
gcc -c -g3 -Wall act_wiz.c
In file included from act_wiz.c:29:
mud.h:4973: warning: `/*' within comment
gcc -c -g3 -Wall boards.c
In file included from boards.c:27:
mud.h:4973: warning: `/*' within comment
gcc -c -g3 -Wall build.c
In file included from build.c:27:
mud.h:4973: warning: `/*' within comment
build.c: In function `do_goto':
build.c:882: warning: suggest explicit braces to avoid ambiguous `else'
build.c:898: warning: suggest explicit braces to avoid ambiguous `else'
gcc -c -g3 -Wall clans.c
In file included from clans.c:27:
mud.h:4973: warning: `/*' within comment
gcc -c -g3 -Wall comm.c
In file included from comm.c:33:
mud.h:4973: warning: `/*' within comment
In file included from comm.c:62:
/usr/include/netinet/ip.h:167: parse error before `n_long'
/usr/include/netinet/ip.h:167: warning: no semicolon at end of struct or union
/usr/include/netinet/ip.h:167: warning: no semicolon at end of struct or union
/usr/include/netinet/ip.h:170: parse error before `n_long'
/usr/include/netinet/ip.h:170: warning: no semicolon at end of struct or union
/usr/include/netinet/ip.h:171: warning: data definition has no type or storage c
lass
/usr/include/netinet/ip.h:172: parse error before `}'
/usr/include/netinet/ip.h:172: warning: data definition has no type or storage c
lass
/usr/include/netinet/ip.h:173: parse error before `}'
comm.c: In function `new_descriptor':
comm.c:867: warning: implicit declaration of function `save_sysdata'
make[1]: *** [comm.o] Error 1
make[1]: Leaving directory `/cygdrive/c/dist/swr10/src'
make: *** [all] Error 2
Australia Forum Administrator #4
Can you tell me exactly where you got this source, so I can try it out?
#5
I got it at

http://www.archsysinc.com/lotj/tools.htm

It's the ported one without the exe
Australia Forum Administrator #6
I just got that exact file, unzipped it into my Cygwin home directory and compiled it OK. Here is the output ...


$ make
make swreality
make[1]: Entering directory `/home/nick/swr10/src'
gcc -c -g3 -Wall    act_comm.c
gcc -c -g3 -Wall    act_info.c
gcc -c -g3 -Wall    act_move.c
gcc -c -g3 -Wall    act_obj.c
act_obj.c: In function `can_layer':
act_obj.c:1107: warning: suggest explicit braces to avoid ambiguous `else'
act_obj.c: In function `do_auction':
act_obj.c:2324: warning: suggest explicit braces to avoid ambiguous `else'
act_obj.c:2348: warning: suggest explicit braces to avoid ambiguous `else'
gcc -c -g3 -Wall    act_wiz.c
gcc -c -g3 -Wall    boards.c
gcc -c -g3 -Wall    build.c
build.c: In function `do_goto':
build.c:882: warning: suggest explicit braces to avoid ambiguous `else'
build.c:898: warning: suggest explicit braces to avoid ambiguous `else'
gcc -c -g3 -Wall    clans.c
gcc -c -g3 -Wall    comm.c
comm.c: In function `new_descriptor':
comm.c:867: warning: implicit declaration of function `save_sysdata'
gcc -c -g3 -Wall    comments.c
gcc -c -g3 -Wall    const.c
gcc -c -g3 -Wall    db.c
db.c: In function `load_resets':
db.c:1416: warning: unused variable `pexit'
db.c:1415: warning: unused variable `pRoomIndex'
gcc -c -g3 -Wall    fight.c
gcc -c -g3 -Wall    handler.c
handler.c: In function `get_eq_char':
handler.c:1208: warning: suggest explicit braces to avoid ambiguous `else'
handler.c: In function `extract_char':
handler.c:1660: warning: suggest explicit braces to avoid ambiguous `else'
handler.c: At top level:
handler.c:2941: warning: type defaults to `int' in declaration of `top_reset'
gcc -c -g3 -Wall    hashstr.c
gcc -c -g3 -Wall    id.c
id.c: In function `set_auth':
id.c:300: warning: unused variable `tlen'
id.c:300: warning: unused variable `ulen'
id.c:298: warning: unused variable `a'
id.c:297: warning: unused variable `ch'
gcc -c -g3 -Wall    interp.c
interp.c:29: warning: `timerclear' redefined
/usr/include/sys/time.h:47: warning: this is the location of the previous defini
tion
gcc -c -g3 -Wall    magic.c
magic.c: In function `process_spell_components':
magic.c:727: warning: suggest explicit braces to avoid ambiguous `else'
magic.c:745: warning: suggest explicit braces to avoid ambiguous `else'
gcc -c -g3 -Wall    makeobjs.c
gcc -c -g3 -Wall    misc.c
misc.c: In function `do_hail':
misc.c:2449: warning: suggest explicit braces to avoid ambiguous `else'
gcc -c -g3 -Wall    mud_comm.c
gcc -c -g3 -Wall    mud_prog.c
gcc -c -g3 -Wall    player.c
gcc -c -g3 -Wall    requests.c
gcc -c -g3 -Wall    reset.c
gcc -c -g3 -Wall    save.c
save.c: In function `load_char_obj':
save.c:913: warning: suggest explicit braces to avoid ambiguous `else'
gcc -c -g3 -Wall    shops.c
shops.c: In function `appraise_all':
shops.c:870: warning: suggest explicit braces to avoid ambiguous `else'
gcc -c -g3 -Wall    skills.c
gcc -c -g3 -Wall    special.c
gcc -c -g3 -Wall    tables.c
gcc -c -g3 -Wall    track.c
gcc -c -g3 -Wall    update.c
gcc -c -g3 -Wall    space.c
space.c: In function `resetship':
space.c:2944: warning: suggest explicit braces to avoid ambiguous `else'
gcc -c -g3 -Wall    bounty.c
gcc -c -g3 -Wall    swskills.c
rm -f swreality
gcc  -o swreality act_comm.o act_info.o act_move.o act_obj.o act_wiz.o boards.o
build.o clans.o comm.o comments.o const.o db.o fight.o handler.o hashstr.o id.o
interp.o magic.o makeobjs.o misc.o mud_comm.o mud_prog.o player.o requests.o res
et.o save.o shops.o skills.o special.o tables.o track.o update.o space.o bounty.
o swskills.o -lm
chmod g+w swreality
chmod: changing permissions of `swreality': No such file or directory
make[1]: *** [swreality] Error 1
make[1]: Leaving directory `/home/nick/swr10/src'
make: *** [all] Error 2


You must have something wrong with your Cygwin setup. :)
Australia Forum Administrator #7
The final error message is just because it tries to do:

chmod g+w swreality

rather than:

chmod g+w swreality.exe

However there was an executable you could run.
#8
What OS are you using?
Australia Forum Administrator #9
NT 4. I downloaded Cygwin recently, and it is that that should be the important thing. I took the defaults that they offered, I think, eg. text handling.
#10
I'll uninstall everything and then just install the default and see what happens then. Hopefully it'll work.
#11
You say you unzipped it to your cygwin directory. Are you supposed to do that all the time or will it work if it's not in the cygwin directory? I guess you can't uninstall cygwin either, I clicked unistall for all the things in setup and it downloaded for two hours and installed even more crap.
#12
Sorry to keep bothering you lick this Nick, but could you post what you have downloaded (in the setup with the lists)?
Australia Forum Administrator #13
See this post:

http://www.gammon.com.au/forum/bbshowpost.php?bbsubject_id=688

I installed most things.
#14
I tried to compile comm.c with Dev-C++ because that's where it seems to be quitting on me and here's the errors I recieved from dev-c++

n file included from c:/dist/swr10/src/comm.c:33:
c:\dist\swr10\src\mud.h:4989: parse error before `*'
c:\dist\swr10\src\mud.h:4989: warning: data definition has no type or storage class
c:\dist\swr10\src\mud.h:4990: parse error before `*'
c:\dist\swr10\src\mud.h:4991: parse error before `*'
c:/dist/swr10/src/comm.c: In function `mainthread':
c:/dist/swr10/src/comm.c:282: `service_shut_down' undeclared (first use in this function)
c:/dist/swr10/src/comm.c:282: (Each undeclared identifier is reported only once
c:/dist/swr10/src/comm.c:282: for each function it appears in.)
c:/dist/swr10/src/comm.c: In function `game_loop':
c:/dist/swr10/src/comm.c:492: `SIGPIPE' undeclared (first use in this function)
c:/dist/swr10/src/comm.c:493: `SIGALRM' undeclared (first use in this function)
c:/dist/swr10/src/comm.c: In function `new_descriptor':
c:/dist/swr10/src/comm.c:759: `arg' undeclared (first use in this function)
c:/dist/swr10/src/comm.c: In function `bailout':
c:/dist/swr10/src/comm.c:3402: `service_shut_down' undeclared (first use in this function)
#15
WOHOOOO, from the huge dump of crap shown below I went into comm.c to line 62 and commented #include < netinet/ip.h > or some hibity dipity like that. After I saved, everything compiled perfectly, but I suppose I need that /usr/include/netinet/ip.h for something. I guess we'll see, as for now I'm trying to figure out the score bug.

Thanks for the help

In file included from comm.c:62:
/usr/include/netinet/ip.h:167: parse error before `n_long'
/usr/include/netinet/ip.h:167: warning: no semicolon at end of struct or union
/usr/include/netinet/ip.h:167: warning: no semicolon at end of struct or union
/usr/include/netinet/ip.h:170: parse error before `n_long'
/usr/include/netinet/ip.h:170: warning: no semicolon at end of struct or union
/usr/include/netinet/ip.h:171: warning: data definition has no type or storage c
lass
/usr/include/netinet/ip.h:172: parse error before `}'
/usr/include/netinet/ip.h:172: warning: data definition has no type or storage c
lass
/usr/include/netinet/ip.h:173: parse error before `}'
comm.c: In function `new_descriptor':
comm.c:867: warning: implicit declaration of function `save_sysdata'
make[1]: *** [comm.o] Error 1
make[1]: Leaving directory `/cygdrive/c/dist/swr10/src'
make: *** [all] Error 2