Total newb

Posted by Bizarro on Sat 05 Dec 2009 07:08 AM — 19 posts, 83,339 views.

#0
Ok, I am wanting to get a DBS Code to run locally so I can learn how to build/code on it and I have no idea how. I was reading around some and installed cygwin but I don't know what else I will need to get it started. If there isn't any other software I need to install to get the MUD to run, great. I have no idea what I need to type in cygwin in order to get the MUD to start a server so I can log into it locally... Yea, I am a total newb when it comes to this.
Australia Forum Administrator #1
See: http://www.gammon.com.au/smaug/howtocompile.htm
#2
Well, that helps me some. I still have no idea what I am doing really. I follow the link and until I get to where the MAKE command is, I can't go any further. Cygwin doesn't seem to understand what the MAKE command is at all. Do I need zlib and what is it?
USA #3
You probably need to run the Cygwin installer/updater again and get Make installed. I'd imagine it's under Development tools, though I'm not sure.

Also, Cygwin is supposedly an -awful- platform to run a MUD off of. 'Andlinux' or running Linux in a virtual machine (look up VMWare) are oft-suggested alternatives... I'd suggest Andlinux, personally. I've never used it, but I have done a VM before, and it's IMO a bit of a hassle.
#4
Ok I got the make for cygwin working now but I am getting an error.

gcc -c -DMCCP -0 -g3 -Wall -DTIMEFORMAT -DIMC -DIMCSMAUG imc.c
make [1]: gcc: Command not found
make [1]: *** [imc.o] Erroc 127
make [1]: Leaving directort 'home/People/dbsc/scr'
make: *** [all] Error 2
USA #5
You need to install GCC too. I don't know what package that's in for Cygwin, sorry. Probably somewhere under Programming.
#6
Found the GCC files. Now its doing this.

mud.h:25:18: zlib.h: no such file or directory


Now do I have to instal zlib or what?


EDIT: Well, I ran the cygwin installer and found zlib in the devel tool directory so it is doing something now.
Amended on Sat 05 Dec 2009 08:21 PM by Bizarro
#7
Getting a different error now.

comm.c:1754: undefined reference to '_deflate'
comm.o in function 'compressStart':
comm.c:5796: undefined reference to '_deflateInit_'
com.o: in function 'compressEnd':
comm.c:5832: undefined reference to '_deflate'
comm.c:5838: undefined reference to '_deflateEnd'
collect2:ld returned exit status
make[1]: *** [dbs] error 1
make[1]: leaving directory '/home/people/dbsc/src'
make: *** [all] error 2

So yea, me being a newb I have no idea what any of that means.

EDIT: Thanks for your help BTW :D
Amended on Sat 05 Dec 2009 09:11 PM by Bizarro
USA #8
Sounds like it's not linking against zlib properly. The only time I've had to deal with these issues was when compiling MUSHclient from source, when I didn't have zlib in the right place. Maybe that's your problem, but I wouldn't know where the 'right' place is for you.
#9
Well, I don't know if zlib would be in the right place or not, I downloaded it via cygwin with the setup.exe so I would assume it would install to the correct spot. O well, maybe someone will have some insight soon :D
Canada #10
Template:post=1085
Please see the forum thread: http://gammon.com.au/forum/?id=1085.

Appears to be similar to your problem even though it's a different code base.

USA #11
Can you paste your Makefile? There may be a section you need to edit to get zlib to work correctly.

Also, when installing Cygwin it is generally best to just install -ALL- packages (unless space is an issue for you). That way you don't have to run the updated repeatedly to get all of it's goodies.

Twisol said:

Also, Cygwin is supposedly an -awful- platform to run a MUD off of. 'Andlinux' or running Linux in a virtual machine (look up VMWare) are oft-suggested alternatives... I'd suggest Andlinux, personally. I've never used it, but I have done a VM before, and it's IMO a bit of a hassle.


I'm not sure I'd call it awful. It may not be ideal, but it does its job quite well. MUDs don't really rely too much on hardware performance, so it is a convenient way to develop and run a MUD, and many people can host it just fine using Cygwin. Cygwin provides pretty good quality replication of a linux environment (though not as good as the real thing of course! :P). I personally make my MUD Cygwin and Linux compatible so that I can develop on my Windows box with Dev-C++, but host it permanently in Linux environment.

I've never used Andlinux, but I have used VirtualBox and it is quite easy to setup and play with.
Amended on Sun 06 Dec 2009 12:16 AM by Nick Cash
#12
Here is a copy/paste of the makefile

CC = gcc
#PROF = -p

# Uncomment the line below if you have problems with math functions
MATH_LINK = -lm

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

#Uncomment the line below if you are getting a line like:
#interp.c:757: warning: int format, time_t arg (arg 7)
TIME = -DTIMEFORMAT

#Uncomment the line below if you are getting implicit decleration of re_exec
#REG = -DREGEX

#Uncomment the line below if you are getting undefined re_exec errors
NEED_REG = -lgnuregex

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

#DBUGFLG = -DREQUESTS

#Uncomment the line below if you want a performance increase though beware
#your core files may not be as much of a benefit if you do.
#OPT_FLAG = -finline-functions -funroll-loops -fdefer-pop -fstrength-reduce

#Uncomment if you wish to enable the Mud Client Compression Protocol
#Comment it out it if you are compiling with Cygwin
OPT_FLAG = -DMCCP

C_FLAGS = $(OPT_FLAG) -O -g3 -Wall $(PROF) $(DBUGFLG) $(SOLARIS_FLAG) $(TIME) $(REG)
L_FLAGS = $(OPT_FLAG) $(PROF) $(SOLARIS_LINK) ${MATH_LINK} -lz

#D_FLAGS : For the DNS Slave process. No need in linking all the extra libs for this.
D_FLAGS = -g3 -O $(PROF) $(SOLARIS_LINK)

O_FILES = act_comm.o act_info.o act_move.o act_obj.o act_wiz.o ban.o \
board.o boards.o bounty.o build.o clans.o colorize.o comm.o \
comments.o const.o db.o deity.o editor.o fight.o finger.o grub.o \
handler.o hashstr.o hiscores.o hotboot.o house.o ibuild.o ident.o \
imm_host.o interp.o magic.o makeobjs.o mapout.o marry.o \
misc.o mpxset.o mud_comm.o mud_prog.o new_fun.o pfiles.o planes.o \
planet.o player.o polymorph.o rare.o requests.o reset.o save.o \
services.o shops.o skills.o skills_android.o skills_dbs.o skills_genie.o \
space.o special.o stat_obj.o tables.o track.o update.o dns.o new_auth.o \
sha256.o

C_FILES = act_comm.c act_info.c act_move.c act_obj.c act_wiz.c ban.c \
board.c boards.c bounty.c build.c clans.c colorize.c comm.c \
comments.c const.c db.c deity.c editor.c fight.c finger.c grub.c \
handler.c hashstr.c hiscores.c hotboot.c house.c ibuild.c ident.c \
imm_host.c interp.c magic.c makeobjs.c mapout.c marry.c \
misc.c mpxset.c mud_comm.c mud_prog.c new_fun.c pfiles.c planes.c \
planet.c player.c polymorph.c rare.c requests.c reset.c save.c \
services.c shops.c skills.c skills_android.c skills_dbs.c\
space.c special.c stat_obj.c tables.c track.c update.c dns.c skills_genie.c \
new_auth.c sha256.c

H_FILES = mud.h bet.h board.h finger.h hotboot.h house.h pfiles.h rare.h new_auth.h

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

all:
make dbs

dbs: $(O_FILES)
rm -f dbsaga
$(CC) $(L_FLAGS) -o dbsaga $(O_FILES)
chmod g+w dbsaga
chmod a+x dbsaga
chmod g+w $(O_FILES)

dns: resolver.o
rm -f resolver
$(CC) $(D_FLAGS) -o resolver resolver.o
chmod g+w resolver
chmod a+x resolver
chmod g+w resolver.o

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

clean:
rm -f *.o dbsaga *~
Canada #13
Quote:
#Uncomment if you wish to enable the Mud Client Compression Protocol
#Comment it out it if you are compiling with Cygwin
OPT_FLAG = -DMCCP


As I said, it's an MCCP - Cygwin problem. Comment out that line:
#OPT_FLAG = -DMCCP
#14
Awesome, it works. One thing, I can't get the Admin character to log on, the password is not working. Any help you can offer me on this? :D :D
Canada #15
Good work :)

If it's not Admin/admin, then I don't know.
You could try creating a new character, then updating the level to admin status manually in the player file.
#16
Yea, that's what I am going to try and do now. The password for Admin was soooo long and it wouldn't work so, I hope this does.

Much thanks for all the help :D
#17
Should I not be able to get the password from opening the pfile in the player/a directory? When I started a new character and got enough experience to save and quit, the player I created didn't exist when I tried to log back on. I really don't get that...


EDIT: I deleted the directory and redid it and admin/admin works now.
Amended on Sun 06 Dec 2009 06:25 AM by Bizarro
Canada #18
Well, no. Passwords are generally encrypted in pfiles. And I don't know enough about DBSC to know why the new player didn't exist. That doesn't happen in my code.

But good to hear you found a work around.

Enjoy :)