Before you can use the compiler you need to configure the tools for your machine. This process requires you to tell the operating system (Windows) where the executable files are, and to tell the compiler where the include and library files are located. You'll also need to tell the compiler if you want to pass any special switches.
To configure the tools we'll write one batch (
BAT
) file and two CFG
files. This assumes you are using Windows 95/98. If you are using NT, W2K, or XP, you can write a CMD file instead of a BAT file, but a BAT file will work as well.We'll start by writing batch file to configure the environment:
- Use any plain text editor to write the batch file. You could use Notepad to accomplish this task.
- Before you make any changes, save the empty file as
StartBC.bat
in theC:\BCC55
directory. If you are running Windows NT or W2K, save the file asStartBC.cmd
instead. Be sure you put quotes around the file name when you save it, oterwise Notepad will save your file asStartBC.bat.txt
. - Add the following two lines to your batch file, and then save it again.
PATH=C:\BCC55\BIN;%PATH%
DOSKEY /INSERT
bcc32.dll
:- Use any plain text editor (such Notepad) to edit the config file.
- Before you make any changes, save the empty file as bcc32.cfg in the C:\BCC55\BIN directory. Note that this is not the same directory where you saved StartBC.bat.
Note: Be sure you put quotes around the file name when you save it, or else Notepad will save your file as bcc32.cfg.txt, which won't work at all. - Add the following lines to your file, and then save it again. Note, however, that if you've installed the compiler in a directory other than
C:\BC55\BIN
, you'll need to adjust the lines so that they reflect the actual location of the compiler's include and library files.-I "C:\BCC55\INCLUDE"
-L "C:\BCC55\LIB;C:\BCC55\LIB\PSDK"
-P
-v-
-w
-DWINVER=0x0400
-D_WIN32_WINNT=0x0400
For your information, each of these lines means:
-I : tells the compiler where to look for system include files
-L : tells the compiler where to look for libraries
-P : tells the compiler to compile using C++, even if the source ends with .c
-v-: tells the compiler to turn off debugging.
-w : tells the compiler to issue warnings
-D : defines several constants so your executables will work with W95/98/NT
Note that the I, L, P, and D are uppercase, while the v and w are lowercase. This is important, because if you use an uppercase W, you generate a Windows application instead of warnings.
ilink32.cfg
:- Use any plain text editor (such Notepad) to edit the config file.
- Before you make any changes, save the empty file as ilink32.cfg in the C:\BCC55\BIN directory. Note that this is not the same directory where you saved StartBC.bat.
Note: Be sure you put quotes around the file name when you save it, or else Notepad will save your file as ilink32.cfg.txt, which won't work at all. - Add the following lines to your file, and then save it again. Note, however, that if you've installed the compiler in a directory other than
C:\BC55\BIN
, you'll need to adjust the lines so that they reflect the actual location of the compiler's include and library files.-v-
-x
-L "C:\BCC55\LIB;C:\BCC55\LIB\PSDK"
For your information, each of these lines means:
-L : tells the linker where to look for libraries
-v-: tells the linker to turn off debugging.
-x : tells the linker not to generate a map file
Note that the L are uppercase, while the v and x are lowercase.
No comments:
Post a Comment