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 ➜ Compiling on Slackware

Compiling on Slackware

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


Posted by Kanzeil   (6 posts)  Bio
Date Tue 18 May 2004 05:59 AM (UTC)
Message
:~/mud/Rom24/src$ make
gcc -c -Wall -O -g act_comm.c
gcc -c -Wall -O -g act_enter.c
gcc -c -Wall -O -g act_info.c
act_info.c: In function `do_look':
act_info.c:1122: warning: suggest explicit braces to avoid ambiguous `else'
act_info.c:1131: 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:424: warning: suggest explicit braces to avoid ambiguous `else'
act_obj.c:462: warning: suggest explicit braces to avoid ambiguous `else'
act_obj.c: In function `get_cost':
act_obj.c:2481: 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
gcc -c -Wall -O -g const.c
gcc -c -Wall -O -g db.c
gcc -c -Wall -O -g db2.c
gcc -c -Wall -O -g effects.c
gcc -c -Wall -O -g fight.c
fight.c: In function `one_hit':
fight.c:571: warning: suggest explicit braces to avoid ambiguous `else'
gcc -c -Wall -O -g flags.c
gcc -c -Wall -O -g handler.c
handler.c: In function `reset_char':
handler.c:565: warning: suggest explicit braces to avoid ambiguous `else'
handler.c: In function `get_max_train':
handler.c:761: warning: suggest explicit braces to avoid ambiguous `else'
handler.c: In function `unequip_char':
handler.c:1644: warning: suggest explicit braces to avoid ambiguous `else'
gcc -c -Wall -O -g healer.c
gcc -c -Wall -O -g interp.c
gcc -c -Wall -O -g note.c
gcc -c -Wall -O -g lookup.c
gcc -c -Wall -O -g magic.c
magic.c: In function `obj_cast_spell':
magic.c:643: warning: suggest explicit braces to avoid ambiguous `else'
magic.c: In function `spell_earthquake':
magic.c:2203: warning: suggest explicit braces to avoid ambiguous `else'
gcc -c -Wall -O -g magic2.c
gcc -c -Wall -O -g music.c
gcc -c -Wall -O -g recycle.c
gcc -c -Wall -O -g save.c
gcc -c -Wall -O -g scan.c
gcc -c -Wall -O -g skills.c
gcc -c -Wall -O -g special.c
gcc -c -Wall -O -g tables.c
gcc -c -Wall -O -g update.c
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 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+0x4796): In function `do_password':
/home/operative/mud/Rom24/src/act_info.c:2722: undefined reference to `crypt'
act_info.o(.text+0x481f):/home/operative/mud/Rom24/src/act_info.c:2739: undefined reference to `crypt'
comm.o(.text+0x17c3): In function `nanny':
/home/operative/mud/Rom24/src/comm.c:1652: undefined reference to `crypt'
comm.o(.text+0x1b0e):/home/operative/mud/Rom24/src/comm.c:1764: undefined reference to `crypt'
comm.o(.text+0x1b98):/home/operative/mud/Rom24/src/comm.c:1787: undefined reference to `crypt'
collect2: ld returned 1 exit status
make: *** [rom] Error 1


Whats wrong here? Im kinda a newb to linux and compiling but what I can see is that theres something wrong in the different files themselves that is screwing with the compile if im not mistaken.. alittle help please?
Top

Posted by David Haley   USA  (3,881 posts)  Bio
Date Reply #1 on Tue 18 May 2004 06:01 AM (UTC)
Message
That means that you're not linking the crypt library. In other words, you don't have the right libraries loaded up, so it can't find the function it needs.

To do so, you need to add -lcrypt to your makefile. I'm surprised it's not there already: could you show me your makefile?

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
Top

Posted by Kanzeil   (6 posts)  Bio
Date Reply #2 on Tue 18 May 2004 06:03 AM (UTC)
Message
Makefile is

CC = gcc
PROF = -O -g
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

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

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


But theres another file called Makefile.linux which has that flag in there

CC = gcc
PROF = -O -g
NOCRYPT =
C_FLAGS = -Wall $(PROF) $(NOCRYPT)
L_FLAGS = $(PROF)
LIBS = -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) $(LIBS)

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

do I gotta rename the .linux one to just Makefile and run it then?
Top

Posted by David Haley   USA  (3,881 posts)  Bio
Date Reply #3 on Tue 18 May 2004 06:06 AM (UTC)
Message
That's a good guess, yes. I'd try that and see if it works.

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
Top

Posted by Kanzeil   (6 posts)  Bio
Date Reply #4 on Tue 18 May 2004 06:09 AM (UTC)
Message
Well it didnt show those crypt errors anymore..

:~/mud/Rom24/src$ make
gcc -c -Wall -O -g act_comm.c
gcc -c -Wall -O -g act_enter.c
gcc -c -Wall -O -g act_info.c
act_info.c: In function `do_look':
act_info.c:1122: warning: suggest explicit braces to avoid ambiguous `else'
act_info.c:1131: 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:424: warning: suggest explicit braces to avoid ambiguous `else'
act_obj.c:462: warning: suggest explicit braces to avoid ambiguous `else'
act_obj.c: In function `get_cost':
act_obj.c:2481: 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
gcc -c -Wall -O -g const.c
gcc -c -Wall -O -g db.c
gcc -c -Wall -O -g db2.c
gcc -c -Wall -O -g effects.c
gcc -c -Wall -O -g fight.c
fight.c: In function `one_hit':
fight.c:571: warning: suggest explicit braces to avoid ambiguous `else'
gcc -c -Wall -O -g flags.c
gcc -c -Wall -O -g handler.c
handler.c: In function `reset_char':
handler.c:565: warning: suggest explicit braces to avoid ambiguous `else'
handler.c: In function `get_max_train':
handler.c:761: warning: suggest explicit braces to avoid ambiguous `else'
handler.c: In function `unequip_char':
handler.c:1644: warning: suggest explicit braces to avoid ambiguous `else'
gcc -c -Wall -O -g healer.c
gcc -c -Wall -O -g interp.c
gcc -c -Wall -O -g note.c
gcc -c -Wall -O -g lookup.c
gcc -c -Wall -O -g magic.c
magic.c: In function `obj_cast_spell':
magic.c:643: warning: suggest explicit braces to avoid ambiguous `else'
magic.c: In function `spell_earthquake':
magic.c:2203: warning: suggest explicit braces to avoid ambiguous `else'
gcc -c -Wall -O -g magic2.c
gcc -c -Wall -O -g music.c
gcc -c -Wall -O -g recycle.c
gcc -c -Wall -O -g save.c
gcc -c -Wall -O -g scan.c
gcc -c -Wall -O -g skills.c
gcc -c -Wall -O -g special.c
gcc -c -Wall -O -g tables.c
gcc -c -Wall -O -g update.c
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 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 -lcrypt

but then I went into my area dir and tried to startup & and it just said

[1] 2516

nothing more.. im guessing that means i gotta fix the rest of those 'ambiguous 'else's' if not what can it be?
Top

Posted by Kanzeil   (6 posts)  Bio
Date Reply #5 on Tue 18 May 2004 06:11 AM (UTC)
Message
well its actually up and running those are just minor errors that can be fixed by brushing up on abit of C++ huh? :)
Top

Posted by David Haley   USA  (3,881 posts)  Bio
Date Reply #6 on Tue 18 May 2004 06:39 AM (UTC)
Message
Yes, the [1] xxxx is just telling you that the job is in the background... however when you logout it might destroy the process, so you have to be careful about that. (i.e. make sure that it's still there once you've logged out.)

Those actually aren't errors, they're just caused by sloppy programming style. The compiler is warning you that the ifs and elses look ambiguous. Of course they're not ambiguous to the compiler; it's just making code style suggestions. :)

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
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.


21,055 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.