MCS' Coding Tips

Setting up the Borland environment

   Written by MCS
   Tested by Quinnsey

Main Page


Wolfenstein 3D
Texture Library

MCS' Coding
Tips - "Success"!





Original Wolf 3D


Other Stuff


Email us!
This tutorial describes how to set up your Borland environment in a comfortable way.
I've learned that some ppl just put their project files in the Borland program directory. Most of the time this type of setup will cause a lot of trouble.
By setting up the program as described below, you will keep things organized. Also, you will be able to maintain multiple project directories using only one copy of the compiler program.
It is recommended that you use Borland C++ version 3.1. Version 3.0 should work also but it has a couple of drawbacks, so you'd better not use it.

If you don't have the Borland C++ 3.1 package yet, you can download it here.

1. Installing the program.

Create a directory on your hard drive called BC31. You can use any drive or subdirectory of your choice. For this example I'll be assuming you created C:\BC31.
Put the zipfile in the root of your C: drive.
Now unzip the zipfile to your new BC31 directory. If you use PKUNZIP for DOS, type PKUNZIP BC31.ZIP -d
The "-d" makes sure that the necessary subdirectories will be created.
If you use WinZip, double-click the zipfile and hit the Extract button. In the extract dialog box, enter C:\ and also make sure that the checkbox "Use Folder Names" has been checked.

2. Adding the program reference to your DOS path.

To make sure that the program can be used within any project directory, you need to add the Borland executable to your DOS path.
Start NOTEPAD and open the file C:\AUTOEXEC.BAT (Don't use Word or Wordpad as these add extra layout information that might prevent your PC from starting up).
Locate the line that starts with PATH (There should be only one).
A typical PATH line looks like this:


Now we have to add the Borland program directory (called C:\BC31\BIN). Just put it at the end of the line (make sure the previous entry ends with a semi-colon):


Save the changes and close Notepad.
You have to restart your computer now in order for the changes to take effect.

3. Configuring your Borland environment.

Open a DOS-box and go to the directory where your project files reside. If you didn't download the Wolf source code package so far, you can do it here.
Unzip the package as described above. Use the directory C:\SOURCE\WOLF
I assume you are in the directory C:\SOURCE\WOLF now.
Now type BC and hit Enter. If you get a DOS error like "Bad command or file name" something went wrong in one of the previous steps.

If all went well, the Borland program will start up with the main screen.

Now we have to configure the directory settings for this project. Hit Alt-O to activate the Options menu, then navigate to "Directories" and hit enter.
Modify the settings as follows:

Include Directories: enter C:\BC31\INCLUDE
Library Directories: enter C:\BC31\LIB
Output Directory: enter OBJ
Source Directories: enter your project directory, e.g. C:\SOURCE\WOLF

If you use C:\SOURCE\WOLF as your project directory, you can skip the rest of this step and continue with step 4. If not, you just have to read on..

Scroll down in the project window (bottom of the screen) until you find SIGNON.OBJ and GAMEPAL.OBJ. Their location, as according to the project window, will be C:\SOURCE\WOLF\OBJ. As this is not the path to your source code OBJ directory, you'll need to change these files. You can't edit their location in the project file, so you'll have to remove these 2 entries and insert 2 new ones. Highlight SIGNON.OBJ and press Delete. Do the same with GAMEPAL.OBJ. Now press the Insert key. The "Add to Project List" dialog box will appear. Navigate to your source code's OBJ directory or type the full path in the name box. You will probably have to change the "*.C" in the name box to "*.OBJ" or you won't see the files you want in the list display. Once you finally find the right directory, SIGNON.OBJ and GAMEPAL.OBJ should be the only OBJ files in there. Double-click them to add them to the project window, and then click Done.

4. Making your first EXE.

The hard work has been done now. Hit Alt-C to activate the Compiler menu, then navigate to "Build All" and hit enter.
If all goes well, the program will create a bunch of OBJ files as well as your very first WOLF3D.EXE file in your output directory (C:\SOURCE\WOLF\OBJ)
Transfer the EXE file to your Wolfenstein directory and see if it works.
If so, congratulations! If not, check all previous steps carefully.
N.B. You will need the "Build All" option just only once. If you make any changes to a particular source file, just hit F9 and the program will automatically recompile only the files that are affected by the changes.

5. Setting up multiple projects.

If you set up the Borland environment as described, you can have multiple project directories on the same drive with just one copy of the Borland program.
Let's say you want to have a second project directory named C:\SOURCE\WOLF2
Copy all the necessary project files to this directory. Immediately after this, copy the WOLF3D.PRJ file from C:\SOURCE\WOLF to C:\SOURCE\WOLF2
Now fire up Borland from C:\SOURCE\WOLF2 and select Options-Directories again.
You only have to adjust the "Source Directories" entry this time. Enter C:\SOURCE\WOLF2 and press OK. Done!
You will find all the output for this project in C:\SOURCE\WOLF2\OBJ

6. Checking your Wolf data files.

If your EXE compiles OK, but the graphics look screwed up in the game, you might have the graphic files from  a different Wolf version. In that case, you can download a set of compatible graphic files here.