Compiles fine, but commands won't work when I start it
Posted by Dbaker84
on Mon 04 Aug 2008 09:19 PM
— 19 posts, 79,509 views.
I just downloaded, unzipped, and compiled a fresh install of smaugfuss 1.9 on cygwin. It compiled with no errors and everything seemed to be okay. I started the server and logged on with admin, but for some reason no commands were recognized; I got "Huh?" for everything on tried. Socials *did* work though.
I closed it down and recompiled and restarted it, and watched the start more closely this time. I found that I was getting a ton of errors similar to the following:
BUG: Error location XXXXX in symbol dable. No error
BUG: fread_command: Function XXXXX not found for XXXXX.
There appears to be one of these errors for every command, leading me to believe that things aren't compiling right after all. I vaguely remember having this problem when I compiled a 1.7 more than a year ago, but I don't have any idea how I fixed it. I'm using the generic Makefile with the line for cygwin near the beginning uncommented; no changes other than that. Any help would be greatly appreciated
Do you have the dynamic link library? I think it's called libdl in the Cygwin package list.
I believe when I installed cygwin I installed EVERYTHING, but then again I'm relatively new to all this. What would be the easiest way to check that?
You would re-run the setup.exe program and make sure that the entry "libdl" is checked. (Note though that it might not be called exactly that... I'm at work and going from memory here.)
Or maybe you already have it installed, and need to add -ldl to the linker flags...
Looks like libdl is there, and I added -ldl to my L_FLAGS line; it's still doing the exact same things.
Here's the makefile, just in case I've screwed something up
CC = g++
#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 -Wconversion -Wwrite-strings
C_FLAGS = -g2 $(W_FLAGS) $(SOLARIS_FLAG) $(PROF) $(EXPORT_SYMBOLS)
L_FLAGS = $(PROF) $(SOLARIS_LINK) -lz $(NEED_DL) -ldl
#D_FLAGS : For the DNS Slave process. No need in linking all the extra libs for this.
D_FLAGS = -g2 -O $(PROF) $(SOLARIS_LINK)
C_FILES = act_comm.c act_info.c act_move.c act_obj.c act_wiz.c ban.c boards.c \
build.c calendar.c chess.c clans.c color.c comm.c comments.c const.c db.c deity.c \
dns.c fight.c handler.c hashstr.c hint.c hotboot.c imm_host.c interp.c \
liquids.c magic.c makeobjs.c mapout.c mapper.c mccp.c \
misc.c mpxset.c mud_comm.c mud_prog.c news.c planes.c player.c polymorph.c \
renumber.c reset.c save.c services.c sha256.c shops.c skills.c special.c tables.c \
track.c update.c variables.c weather.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
$(MAKE) -s dns
# 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 dependencies.d resolver.exe resolver.o *~
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 dependencies.d resolver resolver.o *~
endif
dns: resolver.o
rm -f resolver
$(CC) $(D_FLAGS) -o resolver resolver.o
@echo "Done compiling DNS resolver.";
chmod g+w resolver
chmod a+x resolver
chmod g+w resolver.o
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) $<
I just realized something weird was happening when I compiled:
/usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../../1686-pc-cygwin/bin/ld: warning: auto-importing has been activated without --enable-auto-import specified on the command line.
This should work unless it involves constant datat structures referencing symbols from auto-imported DLLs.Info: resolving __timezone by linking to __imp__timezone (auto-import)
Cygwin and dynamic linking can be rather hit and miss, I would suggest not using cygwin at all and installing andlinux.
Unlike cygwin which emulates linux, Andlinux is a port of the linux kernal to the windows environment, which means it is native linux and you do not have any of the troubles that arise with emulation.
Andlinux installs just like an application in any 32 bit windows environment and can run any linux application using windows as the desktop.
Check it out, it will make your life a whole lot easier, real linux without the dual boot hassles.
This is supposed to be working out of the box; even if other solutions exist it's a little disconcerting that basic commands aren't working. I don't have access to Cygwin otherwise I'd take a look myself. Maybe somebody else has an idea?
Okay, finally got it to work somehow. I redownloaded the entire package and started from square one. It still wasn't linking properly, but putting the -ldl in L_FLAGS of the new Makefile seems to have fixed the problem. I'm still getting fread errors on mpechozone, mez, and style and a few other commands. Other than that, things seem to be okay.
Thanks for the update, I'll post if anything else goes wonky.
Im having the same issue, but when i make and start, nothing shows up at all...
Ok i lied i didnt notice it was going to a log somewhere. Yea Im getting the fread errors too...
Did you try what was suggested?
Im not sure exactly where to put the -ldl so heres where i put it...
L_FLAGS = $(PROF) $(SOLARIS_LINK) -lz $(NEED_DL) -ldl
If thats wrong let me know...but yea i put that in, did make and started it up. Still no luck.
What about the Cygwin packages?
From what I can tell from what I can download, yea I have it. I also downloaded the smaugfuss executable and that comes with 2 cygwin parts, but Im not sure if i need to move those or what.
Why did you download the executable?
Uhh... because at the time I didnt really know what I was doing in terms of getting 'make' to work but after figuring out where to get and, Ive gotten over the precompiled need.
Well adding to the Makefile isn't going to instantly fix the problem. You would need to make. Which means not using a downloaded exec.
Or do you mean you're using your compiled version now?
Ok i started out downloading the two files from here, the executable and the 1.9tgz. Thats wat im working with, and wat isnt working. I also downloaded the smaug17fuss file and that gives me the same errors as the other one. Not sure what Im doing wrong here, or if Im doing anything wrong...