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


Register forum user name Search FAQ

Gammon Forum

[Folder]  Entire forum
-> [Folder]  ROM
. -> [Folder]  Compiling the server
. . -> [Subject]  QuickMud/Cygwin Compile Error

QuickMud/Cygwin Compile Error

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


Posted by Di0r   (3 posts)  [Biography] 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.
[Go to top] top

Posted by Nick Gammon   Australia  (23,016 posts)  [Biography] 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
[Go to top] top

Posted by Di0r   (3 posts)  [Biography] 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.

[Go to top] top

Posted by Samson   USA  (683 posts)  [Biography] 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.
[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.


17,125 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]