Comm.c <<<Help>>>

Posted by Steve Aka ZMUD-Stud on Tue 21 Aug 2001 10:12 PM — 5 posts, 19,755 views.

#0
I keep getting this problem while compiling:

gcc -c -O -g3 -Wall -Wuninitialized -p -DNOCRYPT -DROT comm.c
comm.c: In function `main':
comm.c:470: warning: implicit declaration of function `close'
comm.c: In function `read_from_descriptor':
comm.c:1548: warning: implicit declaration of function `read'
comm.c: In function `read_from_buffer':
comm.c:1646: parse error before `else'
comm.c:1587: warning: unused variable `j'
comm.c: At top level:
comm.c:1672: parse error before `if'
comm.c:1692: warning: type defaults to `int' in declaration of `log_string'
comm.c:1692: warning: parameter names (without types) in function declaration
comm.c:1692: conflicting types for `log_string'
merc.h:2884: previous declaration of `log_string'
comm.c:1692: warning: data definition has no type or storage class
comm.c:1693: parse error before string constant
comm.c:1704: warning: type defaults to `int' in declaration of `log_string'
comm.c:1704: warning: parameter names (without types) in function declaration
comm.c:1704: warning: data definition has no type or storage class
comm.c:1705: parse error before string constant
comm.c:1716: parse error before `->'
comm.c:1718: warning: type defaults to `int' in declaration of `write_to_descriptor'
comm.c:1718: conflicting types for `write_to_descriptor'
comm.c:356: previous declaration of `write_to_descriptor'
comm.c:1718: warning: data definition has no type or storage class
comm.c:1725: parse error before `->'
comm.c:1727: warning: type defaults to `int' in declaration of `write_to_descriptor'
comm.c:1727: warning: data definition has no type or storage class
comm.c:1728: parse error before `->'
comm.c:1728: warning: type defaults to `int' in declaration of `strcpy'
comm.c:1728: warning: data definition has no type or storage class
comm.c:1747: parse error before `->'
comm.c:2168: conflicting types for `write_to_descriptor'
comm.c:1727: previous declaration of `write_to_descriptor'
comm.c: In function `write_to_descriptor':
comm.c:2184: warning: implicit declaration of function `write'
make: *** [comm.o] Error 1

WHAT DOES THIS MEAN!?! And how do i fix it?
I'm new to coding.... can't you tell?

I'm using win98se Cygwin (newest version i could d/l)
Australia Forum Administrator #1
There is something very fishy in that source file.

Quite possibly you need to fix the line breaks. Try using Unix2Dos program from my downloads area to change the line endings from Unix to PC style.

Where did you get the source from? The one on my download page has -DSMAUG on the compile line not -DROT.
#2
The -DROT is there because i'm compiling a ROT code base... but i get the same errors on smaug aswell, so i thought i'd kill 2 birds with one stone...

I'll check out the Unix2Dos thing...
#3
Ok, what exactly does Unix2dos.exe do? And what wildcards do i need to put... EG: unix2dos C:/SMAUG/SRC ????

I think what is all...
Australia Forum Administrator #4
Unix2Dos basically converts \n to \r\n which is the way linefeeds are expected on the Dos/Windows platform.

You just change to the src directory, and type:


unix2dos *.c
unix2dos *.h