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 ➜ Ugh! Sorry, help please?

Ugh! Sorry, help please?

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


Posted by Saint   (16 posts)  Bio
Date Sat 19 Mar 2005 02:22 AM (UTC)
Message
Alright, I've decided to go with the Rom codebase. I've downloaded Rom24b6, and extracted the zip succesfully. However, when I run make, I also run into the following problem. Note this is not the first time either, I've run into this same exact problem on other codebases. Here it is.

comm.c: In function `main':
comm.c:421: warning: implicit declaration of function `close'
comm.c: In function `read_from_descriptor':
comm.c:1073: warning: implicit declaration of function `read'
comm.c: In function `write_to_descriptor':
comm.c:1531: warning: implicit declaration of function `write'
comm.c: In function `nanny':
comm.c:1652: warning: implicit declaration of function `crypt'
comm.c:1652: warning: passing arg 1 of `strcmp' makes pointer from integer witho
ut a cast
comm.c:1764: warning: assignment makes pointer from integer without a cast
comm.c:1787: warning: passing arg 1 of `strcmp' makes pointer from integer witho
ut a cast
gcc -c -Wall -O -g const.c
gcc -c -Wall -O -g db.c
db.c:54: error: conflicting types for `random'
/usr/include/stdlib.h:183: error: previous declaration of `random'
db.c:56: error: conflicting types for `srandom'
/usr/include/stdlib.h:184: error: previous declaration of `srandom'
make: *** [db.o] Error 1

Steven@computer ~/rom24/src
$

That silly srandom thing. I just cannot figure it out. Any help would be greatly appreciated. Thanks.
Top

Posted by Saint   (16 posts)  Bio
Date Reply #1 on Sat 19 Mar 2005 02:54 AM (UTC)
Message
Alright fixed the srandom thing. Thankfully. Hehe, but now, I run into another problem, and this one I have absolutely NO idea what to do.

Steven@computer ~/rom24/src
$ make
rm -f rom
gcc -O -g -o rom 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 he
aler.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
act_info.o(.text+0x501f): In function `do_password':
/home/Steven/rom24/src/act_info.c:2722: undefined reference to `_crypt'
act_info.o(.text+0x50b6):/home/Steven/rom24/src/act_info.c:2739: undefined refer
ence to `_crypt'
comm.o(.text+0x1a65): In function `nanny':
/home/Steven/rom24/src/comm.c:1652: undefined reference to `_crypt'
comm.o(.text+0x1e27):/home/Steven/rom24/src/comm.c:1764: undefined reference to
`_crypt'
comm.o(.text+0x1ebe):/home/Steven/rom24/src/comm.c:1787: undefined reference to
`_crypt'
collect2: ld returned 1 exit status
make: *** [rom] Error 1

Steven@computer ~/rom24/src
$

Grrrrrrrr...Any help guys? Please?
Top

Posted by Zeno   USA  (2,871 posts)  Bio
Date Reply #2 on Sat 19 Mar 2005 02:59 AM (UTC)
Message
Did you install the crypt lib as answered in your last topic?

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
Top

Posted by Saint   (16 posts)  Bio
Date Reply #3 on Sat 19 Mar 2005 03:05 AM (UTC)
Message
I did :)
Top

Posted by Samson   USA  (683 posts)  Bio
Date Reply #4 on Sat 19 Mar 2005 03:02 PM (UTC)
Message
And do you have -lcrypt on your L_FLAGS ?
Top

Posted by Saint   (16 posts)  Bio
Date Reply #5 on Sun 20 Mar 2005 12:55 AM (UTC)
Message
I've tried everything you guys suggested, and still no go. Here is a copy of my makefile, and the log of what I get when I try MAKE.
---Makefile
CC = gcc
PROF = -O -g
NOCRYPT = -DNOCRYPT
C_FLAGS = -Wall $(PROF) $(NOCRYPT) -DOLD_RAND
L_FLAGS = $(PROF) -lcrypt

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

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

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

--------------------------------------------------------
Log

magic.c: In function `spell_earthquake':
magic.c:2205: warning: suggest explicit braces to avoid ambiguous `else'
gcc -c -Wall -O -g -DNOCRYPT -DOLD_RAND magic2.c
gcc -c -Wall -O -g -DNOCRYPT -DOLD_RAND music.c
gcc -c -Wall -O -g -DNOCRYPT -DOLD_RAND recycle.c
gcc -c -Wall -O -g -DNOCRYPT -DOLD_RAND save.c
gcc -c -Wall -O -g -DNOCRYPT -DOLD_RAND scan.c
gcc -c -Wall -O -g -DNOCRYPT -DOLD_RAND skills.c
gcc -c -Wall -O -g -DNOCRYPT -DOLD_RAND special.c
gcc -c -Wall -O -g -DNOCRYPT -DOLD_RAND tables.c
gcc -c -Wall -O -g -DNOCRYPT -DOLD_RAND update.c
rm -f rom
gcc -O -g -lcrypt -o rom 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 hand
ler.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
act_info.o(.text+0x4f43): In function `do_password':
/home/Steven/rom24/src/act_info.c:2732: undefined reference to `_crypt'
act_info.o(.text+0x4fda):/home/Steven/rom24/src/act_info.c:2749: undefined refer
ence to `_crypt'
collect2: ld returned 1 exit status
make: *** [rom] Error 1

Steven@computer ~/rom24/src
$
----------------------------------------------------------
Any help, again, would be much appreciated.
Top

Posted by Raz   (32 posts)  Bio
Date Reply #6 on Sun 20 Mar 2005 05:58 PM (UTC)
Message
Quote:
I've tried everything you guys suggested, and still no go. Here is a copy of my makefile, and the log of what I get when I try MAKE.


Scratch what Samson said. He had the right idea, but it is the wrong place to put it. Look here:

Quote:
$(CC) $(L_FLAGS) -o rom $(O_FILES)


Currently, the option -lcrypt is contained in the variable L_FLAGS. The problem with that is gcc requires that the library *must* come *after* the object file which needs it.

In short, place -lcrypt at the end of this line and everything should link fine.

-Raz
C++ Wiki: http://danday.homelinux.org/dan/cppwiki/index.php
Top

Posted by Saint   (16 posts)  Bio
Date Reply #7 on Mon 21 Mar 2005 04:53 PM (UTC)
Message
Totally Awesome! Finally, thanks to you guys, I got my rom up and running! Now I can get into the fun of porting my 17 smaug areas with over 200 rooms in each converted to run under rom! *Big toothy grin*

Special thanks to Raz, once I added that bit of code, it went well. Thanks to you all for taking the time out to offer advice, I've learned greatly from everyone. Thanks!
Top

Posted by Samson   USA  (683 posts)  Bio
Date Reply #8 on Tue 22 Mar 2005 06:16 PM (UTC)

Amended on Tue 22 Mar 2005 06:30 PM (UTC) by Samson

Message
Quote:

$(CC) $(L_FLAGS) -o rom $(O_FILES)


Or you could change the above to:

Quote:

$(CC) -o rom $(O_FILES) $(L_FLAGS)


And it would accomplish the same thing with -lcrypt on the L_FLAGS line.


Incidentaly, issues with crypt are why I resorted to getting the MD5 password code to work for this stuff. That way no more dealing with crypt and it's crap :)

Most folks who have actually provided feedback say they like it - especially when jumping back and forth between Cygwin and Linux pfiles.
Top

Posted by Raz   (32 posts)  Bio
Date Reply #9 on Tue 22 Mar 2005 10:05 PM (UTC)
Message
Quote:
Or you could change the above to:


$(CC) -o rom $(O_FILES) $(L_FLAGS)



And it would accomplish the same thing with -lcrypt on the L_FLAGS line.


True. However, it is probably best to do:


$(CC) $(L_FLAGS) -o rom $(O_FILES) $(LIB_FLAGS)


And add a variable called LIB_FLAGS with all the libraries that you wish to include. It seems that gcc has a weird system of parsing the flags as it goes left to right, so an option might not be turned on until it is read on the command line.

Quote:
Incidentaly, issues with crypt are why I resorted to getting the MD5 password code to work for this stuff. That way no more dealing with crypt and it's crap :)


That was probably a good choice for another reason. You would have left Windows systems out of the loop since they do not have a similar function AFAIK. Packing a custom algorithm with IMC was a good idea in the long-run for maintaing and porting the code.

-Raz
C++ Wiki: http://danday.homelinux.org/dan/cppwiki/index.php
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.


25,108 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.