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 ➜ QuickMud/Cygwin Compile Error

QuickMud/Cygwin Compile Error

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


Posted by Di0r   (3 posts)  Bio
Date Sat 01 Mar 2008 11:15 PM (UTC)

Amended on Sun 02 Mar 2008 01:51 AM (UTC) by Di0r

Message
Alright, so, I was interested in getting ROM again to play with, so I checked out QuickMUD, thought it sounded snazzy, downloaded it, got cygwin, downloaded the required stuff from devel (make, gcc and all that good stuff). I'm using the Makefile provided in what I assume is the most recent version of QuickMUD here: http://www.mudbytes.net/index.php?a=files&cid=259

However, when I do a make on the src folder, I get this error:


$ make
gcc -O -g3 -Wall -DIMC -DUMCROM -c -o obj/db.o db.c
db.c:56: error: conflicting types for 'random'
/usr/include/cygwin/stdlib.h:27:error: previous declaration of 'random' was here
db.c:56: error: conflicting types for 'random'
/usr/include/cygwin/stdlib.h:27:error: previous declaration of 'random' was here
db.c:60: error: conflicting types for 'srandom'
/usr/include/cygwin/stdlib.h:28:error: previous declaration of 'srandom' was here
db.c:60: error: conflicting types for 'srandom'
/usr/include/cygwin/stdlib.h:28:error: previous declaration of 'srandom' was here
make: *** [obj/db.o] Error 1


This is the makefile:


# $Id $

# Makefile for Rom24. Works fine on my Debian system.
# You may need to use 'gmake' on BSD systems.

CC = gcc
RM = rm
EXE = rom
PROF = -O -g3

C_FLAGS = $(PROF) -Wall
L_FLAGS = $(PROF) -lcrypt

#IMC2 - Comment out to disable IMC2 support
IMC = 1

ifdef IMC
   C_FLAGS := $(C_FLAGS) -DIMC -DIMCROM
endif

# Source Files
SRC_FILES := $(wildcard *.c)

# Object Files
OBJ_DIR = obj
OBJ_FILES := $(patsubst %.c,$(OBJ_DIR)/%.o,$(SRC_FILES))

rom: $(OBJ_FILES)
	$(RM) -f $(EXE)
	$(CC) -o $(EXE) $(OBJ_FILES) $(L_FLAGS)

$(OBJ_DIR)/%.o: %.c
	$(CC) $(C_FLAGS) -c -o $@ $<

clean:
	$(RM) -f $(OBJ_FILES) $(EXE) *~ *.bak *.orig *.rej

distro:
	make clean
	cd ../..
	$(RM) -f log/*.log
	tar zvcf quickmud-`date -I`.tar.gz QuickMUD


Any help would be greatly appreciated.
Top

Posted by Nick Gammon   Australia  (23,140 posts)  Bio   Forum Administrator
Date Reply #1 on Sun 02 Mar 2008 01:27 AM (UTC)
Message
The definition in stdlib.h is this:


int random (void);


What do you have for "random" in line 56 of db.c?

- Nick Gammon

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

Posted by Di0r   (3 posts)  Bio
Date Reply #2 on Sun 02 Mar 2008 01:40 AM (UTC)

Amended on Sun 02 Mar 2008 01:57 AM (UTC) by Di0r

Message
Line 56 has:

long random ();


EDIT: Whoops, my bad. The previous log in the first post should've read "srandom", and not "random" like it did. I've went back to the OP and changed it. Sorry about that.

EDIT2: Alright, I changed line 56 of db.c to int random (void), and changed 60 to long srandom(unsigned). It looks like the declarations were just funky. Cheers, Nick.

Top

Posted by Samson   USA  (683 posts)  Bio
Date Reply #3 on Wed 05 Mar 2008 04:55 AM (UTC)
Message
You don't really need to declare random() yourself at all if the standard libraries have done that for you. Makes for less confusion and weird errors.
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.


18,488 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.