[Home] [Downloads] [Search] [Help/forum]


Register forum user name Search FAQ

Gammon Forum

[Folder]  Entire forum
-> [Folder]  ROM
. -> [Folder]  Compiling the server
. . -> [Subject]  Compiling Rom2.4 on Linux

Compiling Rom2.4 on Linux

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


Posted by Krono   (5 posts)  [Biography] bio
Date Wed 23 Jul 2003 08:24 PM (UTC)
Message
I am having a problem compiling Rom2.4 on linux but I got the same thing running on cygwin fine. Here is what I encounter:

gcc -c -Wall -O -ggdb -Dunix -DOLD_RAND -DNOCRYPT act_comm.c
act_comm.c: In function `do_push_drag':
act_comm.c:2099: warning: implicit declaration of function `do_look'
gcc -c -Wall -O -ggdb -Dunix -DOLD_RAND -DNOCRYPT act_enter.c
gcc -c -Wall -O -ggdb -Dunix -DOLD_RAND -DNOCRYPT act_info.c
act_info.c: In function `do_look':
act_info.c:1168: warning: suggest explicit braces to avoid ambiguous `else'
act_info.c:1177: warning: suggest explicit braces to avoid ambiguous `else'
gcc -c -Wall -O -ggdb -Dunix -DOLD_RAND -DNOCRYPT act_move.c
gcc -c -Wall -O -ggdb -Dunix -DOLD_RAND -DNOCRYPT act_obj.c
act_obj.c: In function `get_cost':
act_obj.c:2717: warning: suggest explicit braces to avoid ambiguous `else'
gcc -c -Wall -O -ggdb -Dunix -DOLD_RAND -DNOCRYPT act_wiz.c
gcc -c -Wall -O -ggdb -Dunix -DOLD_RAND -DNOCRYPT alias.c
gcc -c -Wall -O -ggdb -Dunix -DOLD_RAND -DNOCRYPT ban.c
gcc -c -Wall -O -ggdb -Dunix -DOLD_RAND -DNOCRYPT comm.c
comm.c:176: conflicting types for `getpeername'
/usr/include/sys/socket.h:127: previous declaration of `getpeername'
comm.c:177: conflicting types for `getsockname'
/usr/include/sys/socket.h:115: previous declaration of `getsockname'
comm.c: In function `process_output':
comm.c:1254: warning: suggest explicit braces to avoid ambiguous `else'
make: *** [comm.o] Error 1

This is my makefile:

CC = gcc
PROF = -O -ggdb
NOCRYPT =
C_FLAGS = -Wall $(PROF) $(NOCRYPT)
L_FLAGS = $(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 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 mob_cmds.o mob_prog.o olc.o olc_act.o olc_save.o bit.o \
mem.o string.o olc_mpcode.o

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

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

I don't know what i need to do cause it compiles fine on windows using cygwin =/ Thanks for helping =)
[Go to top] top

Posted by Nick Gammon   Australia  (22,973 posts)  [Biography] bio   Forum Administrator
Date Reply #1 on Wed 23 Jul 2003 10:06 PM (UTC)
Message
I compiled that file OK. Exactly which version of ROM do you have? Where did you download it from? Which Linux are you using?


...
gcc -c -Wall -O -g -DNOCRYPT -DOLD_RAND -Dunix act_wiz.c
gcc -c -Wall -O -g -DNOCRYPT -DOLD_RAND -Dunix alias.c
gcc -c -Wall -O -g -DNOCRYPT -DOLD_RAND -Dunix ban.c
gcc -c -Wall -O -g -DNOCRYPT -DOLD_RAND -Dunix comm.c
gcc -c -Wall -O -g -DNOCRYPT -DOLD_RAND -Dunix const.c
gcc -c -Wall -O -g -DNOCRYPT -DOLD_RAND -Dunix db.c
gcc -c -Wall -O -g -DNOCRYPT -DOLD_RAND -Dunix db2.c
gcc -c -Wall -O -g -DNOCRYPT -DOLD_RAND -Dunix effects.c
gcc -c -Wall -O -g -DNOCRYPT -DOLD_RAND -Dunix fight.c

...

$ gcc --version

gcc (GCC) 3.2.2 20030222 (Red Hat Linux 3.2.2-5)
Copyright (C) 2002 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


dmesg | less 

Linux version 2.4.20-13.9 (bhcompile@porky.devel.redhat.com) (gcc version 3.2.2
20030222 (Red Hat Linux 3.2.2-5)) #1 Mon May 12 10:55:37 EDT 2003



- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Krono   (5 posts)  [Biography] bio
Date Reply #2 on Thu 24 Jul 2003 02:38 AM (UTC)
Message
http://www.zone.ee/brigadir/rom2.4/rom2.4b4a(OLC1.71+coloUr1.2).zip

this is the one i got and i been working with it(adding push/drag, races, classes, etc..) a bit on windows with cygwin and i decided to upload it to a free mud host place at www.iflipout.com. And i did a rm *.o and make with cygwin just to make sure it still works and then i uploaded it to the linux mud server. and i got that error message =x even now on windows it runs perfectly fine =) maybe the one i downloaded was meant for windows only? anyways thanks for responding =)
[Go to top] top

Posted by Krono   (5 posts)  [Biography] bio
Date Reply #3 on Thu 24 Jul 2003 02:43 AM (UTC)
Message
Oh ya and this is what im using:

gcc (GCC) 3.2.2 20030222 (Red Hat Linux 3.2.2-5)
Copyright (C) 2002 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


Linux version 2.4.20-9 (bhcompile@stripples.devel.redhat.com) (gcc version 3.2.2
20030313 (Red Hat Linux 3.2.2-10)) #1 Wed Apr 2 13:42:50 EST 2003


hehe sorry i forgot to add that last post =)
[Go to top] top

Posted by Nick Gammon   Australia  (22,973 posts)  [Biography] bio   Forum Administrator
Date Reply #4 on Thu 24 Jul 2003 03:14 AM (UTC)
Message
Near the start of comm.c, add a line:


#include <ctype.h>
#include <errno.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <time.h>
#include <unistd.h>  // add this line


A bit further down (line 168) comment out all of the definitions, like this:


#if     defined(linux)
/*
    Linux shouldn't need these. If you have a problem compiling, try
    uncommenting accept and bind.
int     accept          args( ( int s, struct sockaddr *addr, int *addrlen ) );
int     bind            args( ( int s, struct sockaddr *name, int namelen ) );

int     close           args( ( int fd ) );
int     getpeername     args( ( int s, struct sockaddr *name, int *namelen ) );
int     getsockname     args( ( int s, struct sockaddr *name, int *namelen ) );
int     gettimeofday    args( ( struct timeval *tp, struct timezone *tzp ) );
int     listen          args( ( int s, int backlog ) );
int     read            args( ( int fd, char *buf, int nbyte ) );
int     select          args( ( int width, fd_set *readfds, fd_set *writefds,
                            fd_set *exceptfds, struct timeval *timeout ) );
int     socket          args( ( int domain, int type, int protocol ) );
int     write           args( ( int fd, char *buf, int nbyte ) );
*/  // <---- move closing comment to here   
#endif


Then it will compile OK.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Krono   (5 posts)  [Biography] bio
Date Reply #5 on Thu 24 Jul 2003 04:47 AM (UTC)
Message
Thanks Nick =) worked perfectly!!! =D hehe wow much love haha
[Go to top] 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.


14,140 views.

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

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

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

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at HostDash]