How to compile PennMUSH 1.7.2 p2 under Win32
This page describes how to compile and test PennMUSH 1.7.2 patchlevel 2 (the current one as at the time of writing this). It assumes you are using the Microsoft Visual C++ version 5.0 compiler.
Page updated on 20th February 1998.
Download the source files
Download the source from: ftp://ftp.pennmush.org/pub/PennMUSH/Source/
It will be called something like: pennmush.1.7.2p2.tar.gz (however later versions will have a diffent patch number, eg. p3, p4 and so on).
Unzip the source
Use Winzip to unzip it (make sure you preserve folder names). You can get Winzip from: http://www.winzip.com
Set up the project
- Create new project: Pennmush - a Win32 console application
- Rename SRC\LOCAL.DST as SRC\LOCAL.C
- Add all files in SRC directory to the project.
- Remove the following files from the project:
- ANNOUNCE.C
- COMP_B.C
- COMP_H.C
- COMP_W.C
- CONNECT.C
- CONVDB.C
- CSRIMALLOC.C
- FUNCRYPT.C
- GMALLOC.C
- INFO_SLAVE.C
- MKINDX.C
- NMALLOC.C
- PORTMSG.C
- SMALLOC.C
- SWITCHINC.C
- Bring up the "Project Settings" window, C++ tab, Category "Code Generation"
and change "Use run-time library" to "Multithreaded" (or "Debug Multithreaded"
if you are doing a debug build)
- Use Tools > Options > Directories and add the HDRS directory to the directories to be searched for include files - OR - copy all the .h files from the HDRS directory to the SRC directory.
- Get a copy of CONFIG.H ( from ftp://ftp.ozemail.com.au/pub/gammon/pennmush/headers.zip)
- Copy OPTIONS.H.DIST to HDR\OPTIONS.H
- Edit OPTIONS.H and turn on desired options (probably most of them), such as the chat channels and so on. A copy of OPTIONS.H with the appropriate options enabled is in the file: ftp://ftp.ozemail.com.au/pub/gammon/pennmush/headers.zip
- Get a copy of DUNE.H ( from ftp://ftp.ozemail.com.au/pub/gammon/pennmush/headers.zip) \
- Remove extraneous newline characters from SWITCHINC.C, or get a copy from: ftp://ftp.ozemail.com.au/pub/gammon/pennmush/headers.zip
- Copy CONFMAGIC.H to HDRS directory
- In OPTIONS.H change MALLOC_PACKAGE to be 6, ie:
#define MALLOC_PACKAGE 6 - Add line:
#include <time.h>to CONFIG.H, after the line:
#define _config_h_ - Use the GNU shell command to make your cmds.h and funs.h files, by going to
the UTILS directory and typing:
sh mkcmds.shOR - get a copy of these files from ftp://ftp.ozemail.com.au/pub/gammon/pennmush/headers.zip .
- Add: "winmm.lib wsock32.lib" to Project Settings > Link > Object/library modules.
- In CONFIG.H change:
#define HAS_BZERO /**/to:
// #define HAS_BZERO /**/ - Add the lines:
void fork() { panic ("Unable to fork under Win32"); }; void local_commands () { // no local commands }; void local_functions () { // no local functions }; void reserve_aliases () { // no aliases reserved };to LOCAL.C
Compile
You should now be ready to compile. With a bit of luck you will get a handful or warnings, and no errors. If so, copy the PENNMUSH.EXE file (from the Release or Debug directory) to the GAME directory.Test
When testing, note that the output from the MUSH is not written to the screen. It is written to the LOG subdirectory, in a file called GAME.LOG. Look in that file to see how well the program is going.
Get a MUSH.CNF file
- Rename MUSHCNF.DST as MUSH.CNF
- Change the lines:
compress_program compress uncompress_program uncompress compress_suffix .Zto be:
compress_program uncompress_program compress_suffix - Change the line:
forking_dump yesto be:
forking_dump no - Change the lines:
#events_file txt/events.txt #events_index txt/events.idx #index_file txt/index.txt #index_index txt/index.idx #rules_file txt/rules.txt #rules_index txt/rules.idxto be:
events_file txt/events.txt events_index txt/events.idx index_file txt/index.txt index_index txt/index.idx rules_file txt/rules.txt rules_index txt/rules.idx
Get a database
If you don't already have a database, go to the DATA directory and change the name of:MINIMAL.DB
to be
INDB
Start up the server
Type:
pennmush /run
If the program does not immediately exit, try editing the file LOG\GAME.LOG
and check that the last few lines look like this:
Input database verified. Proceeding to analysis.
ANALYZING: data/indb
ANALYZING: data/indb (done)
LOADING: data/indb
READING: done
LOADING: data/indb (done)
LOADING: data/maildb
LOADING: data/maildb (done)
02/20 12:17:43 RPT: No access.cnf file found.
Listening on port 4201
RESTART FINISHED.
If so, use your client program and try connecting to the MUSH. If you have used the minimal database, connect as character "one" - no password.