Building the BCX Runtime Libraries

Building the BCX runtime library for various compilers:

BCX is able to build libraries for/with the following compilers:  Borland C++ 5.5(free), Microsoft Visual C++ Tookit 2003(free), Open Watcom(free and Open Source), Pelles C(free), MinGW's GCC(free and Open Source) and LccWin32(free for personal use only).

NOTE: The first time only! do this:


 DO THIS FIRST

 From the command line 
 run bc with the -l command line switch only,
 no filename.

 For example:

 bc -l

 This will create a subfolder named rtlib
 under your BCX installation folder.  

 Under the BCX\rtlib folder will be 3 subfolders, 
 BCX\rtlib\source, 
 BCX\rtlib\obj, and 
 BCX\rtlib\include.  

 In the BCX\rtlib\rtlib subfolder 
 there will be a batch file called BuildRTL.bat  
 that will automatically build the runtime library
 and include files for you.  
 
 The BuildRTL.bat file will never be overwritten
 by subsequent runs of BC.EXE, so you may modify
 it to suit your environment.  

 After doing the above, go to BCX\rtlib,
 open for editing the BuildRTL.bat file and 
 modify the following lines to suit your environment:

 REM NOTE You must change the location of your compiler installs here

 REM ================================================================

 SET BCX_INSTALL=C:\BCX

 SET MSVCPP_INSTALL="C:\PROGRAM FILES\Microsoft Visual C++ Toolkit 2003"

 SET BCC55_INSTALL=C:\Borland\BCC55

 SET LCC_INSTALL=C:\LCC

 SET PELLES_INSTALL=C:\PellesC

 SET WATCOM_INSTALL=C:\WATCOM

 SET GCC_INSTALL=C:\MINGW

 REM ================================================================

 REM NOTE You must change the location of your compiler installs here

 Now you are ready to build the BCX Runtime Library.

 END DO THIS FIRST

After the first step above is successfully completed, every time you want to build or rebuild the BCX Runtime Library,from the commandline just type:


 
 BuildRTL <parameter>

where <parameter> is the single letter(not case sensitive) designation for the compiler you chose. If the <parameter> is omitted, the batch file will list all of the acceptable compiler letters and then end.

For Pelles C:


 BuildRTL P

For LccWin32:


 BuildRTL L

For Microsoft Visual C++ Toolkit 2003:


 BuildRTL V

For Borland BCC55:


 BuildRTL B

For Open Watcom:


 BuildRTL W

For MinGW GCC:


 BuildRTL G

At the time of this writing you will get one error when you build the library for Open Watcom. Vic McClung will get this corrected over time.

When you run the BuildRTL.bat file, this is what happens.

Each compiler has a different way of reporting errors, so you will just have to examine each folder and the output of the compiler to see if there are any files created and if not you may have to redirect the output of the BuildRTL.bat to a file, for example,

 
 BuildRTL V >errs.txt

or whatever you chose.

That's it for building the library.

Shortly, Vic McClung hopes to have some examples of using the -n commandline switch and the $PROJECT directive to build multi-file projects that link the BCX Runtime code from bcxRT.lib instead of being generated by BCX.

What are the advantages? On larger projects it will speed up translating, compiling and linking.

For more information on the use and advantages of using static link libraries, just Google for "using static link libraries".