Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ ROM ➜ Compiling the server ➜ Problem with the comm.c.........

Problem with the comm.c.........

It is now over 60 days since the last post. This thread is closed.     Refresh page


Posted by Cyrill   (2 posts)  Bio
Date Wed 22 May 2002 08:13 AM (UTC)
Message
$ make > test
gcc -c -Wall -O -g act_comm.c
gcc -c -Wall -O -g act_info.c
act_info.c: In function `do_look':
act_info.c:1126: warning: suggest explicit braces to avoid ambiguous `else'
act_info.c:1135: warning: suggest explicit braces to avoid ambiguous `else'
gcc -c -Wall -O -g act_move.c
gcc -c -Wall -O -g act_obj.c
act_obj.c: In function `do_put':
act_obj.c:427: warning: suggest explicit braces to avoid ambiguous `else'
act_obj.c:465: warning: suggest explicit braces to avoid ambiguous `else'
act_obj.c: In function `get_cost':
act_obj.c:2484: warning: suggest explicit braces to avoid ambiguous `else'
gcc -c -Wall -O -g act_wiz.c
gcc -c -Wall -O -g alias.c
gcc -c -Wall -O -g ban.c
gcc -c -Wall -O -g comm.c
comm.c:212: conflicting types for `gettimeofday'
c:/djgpp/include/time.h:86: previous declaration of `gettimeofday'
comm.c: In function `close_socket':
comm.c:1104: warning: implicit declaration of function `close'
comm.c: In function `read_from_descriptor':
comm.c:1160: warning: implicit declaration of function `read'
comm.c:1176: `EWOULDBLOCK' undeclared (first use in this function)
comm.c:1176: (Each undeclared identifier is reported only once
comm.c:1176: for each function it appears in.)
comm.c: In function `write_to_descriptor':
comm.c:1624: warning: implicit declaration of function `write'
make.exe: *** [comm.o] Error 1

I downloaded the rom code, ported me believe, and used the makefile that was suggested, what I got was an error on the comm.c, telling me that, to the best of my knowledge, something is undeclared, or declared in a way that is messing the whole thing up.. Here's my makefile too:

<pre>

CC = gcc
PROF = -O -g
NOCRYPT =
C_FLAGS = -Wall $(PROF) $(NOCRYPT)
L_FLAGS = $(PROF)

O_FILES = act_comm.o act_info.o act_move.o act_obj.o act_wiz.o alias.o \
ban.o comm.o const.o db.o effects.o fight.o \
handler.o hunt.o interp.o magic.o \
music.o note.o races.o recycle.o \
save.o skills.o special.o tables.o update.o \

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

.c.o: merc.h
$(CC) -c $(C_FLAGS) $<
</pre>
Top

Posted by Nick Gammon   Australia  (23,170 posts)  Bio   Forum Administrator
Date Reply #1 on Wed 22 May 2002 08:27 AM (UTC)
Message
Which ROM did you use exactly? Which operating system are you using? Cygwin or something else?

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Cyrill   (2 posts)  Bio
Date Reply #2 on Wed 22 May 2002 08:32 AM (UTC)

Amended on Wed 22 May 2002 08:36 AM (UTC) by Cyrill

Message
I am using windows 95, with cygwin. As to the rom code, I used a win port from a friend, and then downloaded the one from this site, and have not been able to figure out exactly what is wrong with the comm.c... I'm currently on a amd-k6, 200mhz machine with 16 meg ram, and not a clue as to why I didn't a clean compile. Also, I changed the makefile I had to match yours, and still came up against the error.
Top

Posted by Nick Gammon   Australia  (23,170 posts)  Bio   Forum Administrator
Date Reply #3 on Wed 22 May 2002 10:26 PM (UTC)
Message
The missing things sound like they are from these include files:


#if defined(unix)
#include <fcntl.h>
#include <netdb.h>
#include <netinet/in.h>
#include <sys/socket.h>
#include "telnet.h"
const   char    echo_off_str    [] = { IAC, WILL, TELOPT_ECHO, '\0' };
const   char    echo_on_str [] = { IAC, WONT, TELOPT_ECHO, '\0' };
const   char    go_ahead_str    [] = { IAC, GA, '\0' };
#endif


They won't be included if "unix" is not defined.

In the file "Makefile" make sure this line is there, with the -Dunix at the end ...


C_FLAGS = -Wall $(PROF) $(NOCRYPT) -Dunix

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


15,472 views.

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.