makefile error on another mud of mine cant fix

Posted by Darzeth on Thu 15 Jun 2006 02:41 AM — 22 posts, 77,833 views.

#0
$ make
make smaug
make[1]: Entering directory `/cygdrive/c/sm/src'
gcc -c -O -g3 -Wall -Wuninitialized -DSMAUG act_comm.c
In file included from act_comm.c:32:
mud.h:1: error: parse error before '[' token
mud.h:1: error: stray '\' in program
mud.h:1: error: stray '\' in program
In file included from act_comm.c:32:
mud.h:2:68: too many decimal points in number
mud.h:5: error: parse error before numeric constant
mud.h:5: error: stray '\' in program
mud.h:6:65: warning: character constant too long for its type
act_comm.c: In function `is_profane':
act_comm.c:3363: warning: implicit declaration of function `re_exec'
make[1]: *** [act_comm.o] Error 1
make[1]: Leaving directory `/cygdrive/c/sm/src'
make: *** [all] Error 2

wat do i need to fix in here to get it to work. note this mud ditn come with a makefile so i took one from a similar mud.
USA #1
It didn't come with a Makefile? What codebase exactly are you using?
#2
smaug1.4 for windows i think it has the start up exe file so all i got to do is click it to turn it on. It didnt come with a help file but i want to do editing tot his mud.
USA #3
Well, do you want to do coding or not? If you do, I'd again suggest to use SmaugFUSS. If not, I guess I would suggest to use SmaugWiz.
#4
is there a smaugfuss that has exe start up command for it cause it seems to have problems on my comp and deosnt want to start up otherwise. Cause i do want to code, but the nohup comand wont let me start the mud over here.
#5
i wish i can just write a makefile for my smaug code lol. to make things easier i jsut wish i can make it work so i can use the exe command that came with the mud. i can edit the code jsut cant compile it.
USA #6
Let me just ask, are you using Cygwin or no?
#7
yes im using cygwin
USA #8
Well then SmaugFUSS should be fine. It shouldn't come with a .exe anyways. What problem did you exactly have with SmaugFUSS?
#9
Compiling o/update.o....
/usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../../i686-pc-cygwin/bin/ld: cannot find
-ldl
collect2: ld returned 1 exit status
make[1]: *** [smaug] Error 1
make: *** [all] Error 2

that

and i dont know how to exactly start it up after i get that fixed.
USA #10
I've already explained how to fix it. There is a flag in the Makefile you need to toggle. If you don't understand, just let me know.

And as for starting it, run the exec or do this:
./startup &
#11
i dont know how to toggle it i should have said that sorry. im a idiot when comign to this im so new.
USA #12
Okay, look in the Makefile for a line that mentions ldl or the sort. It should say to uncomment or comment the line below. Do so by removing (or adding) a # in front of the line.
#13
theres a problem im on the mud but i cant do anything it wont le tme talk or use mset or nothing
USA #14
No commands work? Does anything work?
#15
if i type l it says u complaina bout lag
if i type n it saysur nagged

so no comaands work it lets u log in thats about it after that you cant event alk on it.
USA #16
So socials work, but not commands.

Read over the Makefile again and make sure all relevant flags are on.
#17
CC = gcc
#PROF = -p

#Uncomment to compile in Cygwin
#CYGWIN = -DCYGWIN

#Uncomment the line below if you are getting undefined references to dlsym, dlopen, and dlclose.
#Comment it out if you get errors about ldl not being found.
#NEED_DL = -ldl

#Some systems need this for dynamic linking to work.
EXPORT_SYMBOLS = -export-dynamic

# Uncomment the two lines below if compiling on a Solaris box
#SOLARIS_FLAG = -Dsun -DSYSV
#SOLARIS_LINK = -lnsl -lsocket

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

W_FLAGS = -Wall -Werror -Wshadow -Wformat-security -Wpointer-arith -Wcast-align -Wredundant-decls -Wstrict-prototypes

C_FLAGS = -g2 $(W_FLAGS) $(SOLARIS_FLAG) $(PROF) $(EXPORT_SYMBOLS)
L_FLAGS = $(PROF) $(SOLARIS_LINK) -lz $(NEED_DL)

C_FILES = act_comm.c act_info.c act_move.c act_obj.c act_wiz.c ban.c boards.c \
build.c clans.c color.c comm.c comments.c const.c db.c deity.c fight.c \
handler.c hashstr.c hotboot.c imm_host.c interp.c magic.c makeobjs.c mapout.c mccp.c \
misc.c mpxset.c mud_comm.c mud_prog.c planes.c player.c polymorph.c \
reset.c save.c services.c sha256.c shops.c skills.c special.c tables.c \
track.c update.c

ifdef IMC
C_FILES := imc.c $(C_FILES)
C_FLAGS := $(C_FLAGS) -DIMC -DIMCSMAUG
endif

O_FILES := $(patsubst %.c,o/%.o,$(C_FILES))

H_FILES = $(wildcard *.h)

all:
$(MAKE) -s smaug

# pull in dependency info for *existing* .o files
-include dependencies.d

ifdef CYGWIN
smaug: $(O_FILES)
rm -f smaug.exe
dlltool --export-all --output-def smaug.def $(O_FILES)
dlltool --dllname smaug.exe --output-exp smaug.exp --def smaug.def
$(CC) -o smaug.exe $(O_FILES) smaug.exp $(L_FLAGS)
echo "Generating dependency file ...";
$(CC) -MM $(C_FLAGS) $(C_FILES) > dependencies.d
perl -pi -e 's.^([a-z]).o/$$1.g' dependencies.d
echo "Done compiling mud.";
chmod g+w smaug.exe
chmod a+x smaug.exe
chmod g+w $(O_FILES)

clean:
rm -f o/*.o smaug.exe *~
@echo "Generating dependency file ...";
@$(CC) -MM $(C_FLAGS) $(C_FILES) > dependencies.d
@perl -pi -e 's.^([a-z]).o/$$1.g' dependencies.d
else
smaug: $(O_FILES)
rm -f smaug
$(CC) -export-dynamic -o smaug $(O_FILES) $(L_FLAGS)
echo "Generating dependency file ...";
$(CC) -MM $(C_FLAGS) $(C_FILES) > dependencies.d
perl -pi -e 's.^([a-z]).o/$$1.g' dependencies.d
echo "Done compiling mud.";
chmod g+w smaug
chmod a+x smaug
chmod g+w $(O_FILES)

clean:
rm -f o/*.o smaug *~
@echo "Generating dependency file ...";
@$(CC) -MM $(C_FLAGS) $(C_FILES) > dependencies.d
@perl -pi -e 's.^([a-z]).o/$$1.g' dependencies.d
endif

indent:
indent -ts3 -nut -nsaf -nsai -nsaw -npcs -npsl -ncs -nbc -bls -prs -bap -cbi0 -cli3 -bli0 -l125 -lp -i3 -cdb -c1 -cd1 -sc -pmt $(C_FILES)
indent -ts3 -nut -nsaf -nsai -nsaw -npcs -npsl -ncs -nbc -bls -prs -bap -cbi0 -cli3 -bli0 -l125 -lp -i3 -cdb -c1 -cd1 -sc -pmt $(H_FILES)

indentclean:
rm *.c~ *.h~

o/%.o: %.c
echo " Compiling $@....";
$(CC) -c $(C_FLAGS) $< -o $@

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

thats the file itself
im not sure what has to be on
Australia #18
#Uncomment the line below if you are getting undefined references to dlsym, dlopen, and dlclose.
#Comment it out if you get errors about ldl not being found.
#NEED_DL = -ldl

#Some systems need this for dynamic linking to work.
EXPORT_SYMBOLS = -export-dynamic

I think if you need to uncomment NEED_DL for this to work propperly.
USA #19
You also need to uncomment this line, like it says in the comment:
#CYGWIN = -DCYGWIN
USA #20
I think he just commented out NEED_DL because it wouldn't compile.
#21
thanks all my muds up and running now thanks you all for the help and ill be sure to be back to ask more questions.