C++ Home
Compilers
Links
Books
Forums
SiteMap
Contact Us


Search

 

Borland Command Line Compiler v5.5

This is a free version of the Borland C++ compiler. Here I will tell you what you can expect from it, how to set it up and how to enhance it.


Index:

  1. Review
  2. Setup
  3. Downloads / Important Links

Features:

Here's what you can expect from this compiler:

  • A Command Line compiler.
  • Ability to compile Win32 programs and DLL's.
  • Ability to make programs according to the latest C and C++ standards.

Please don't expect:

  • A custom made IDE in which to make your programs.
  • Ability to use C++ Builder components ( there is no VCL)
  • Ability to instantly build OLE/COM/ActiveX components.

 

Return to top


Review:

This compiler is a good download for those who want to use a widely compatible C/C++ compiler. It is the compiler that is currently being used in Borland's commercial C++ development app 'C++ Builder'. The libraries that come with this compiler have been written solely for windows and have been tried and tested for years. Borland have been in the business of making C/C++ compilers right from the ancient Turbo days and so you will be in good hands with this compiler.

Return to top


Setup:

Important Note: In all the examples given below you must be at the C:\Borland\BCC55\Bin location in the command prompt before executing the given commands.

Basic Setup

When you complete the download you should find your self with a large file named freecommandlinetools.exe. Double click this file and extract it to an appropriate location on your hard drive. I recommend that you extract the files to the default directory i.e... C:\Borland. You will need to create bcc32.cfg and ilink32.cfg files and place then in the \Bin directory of your installation. Here is what you need to add in these files.

For the bcc32.cfg file add the following lines to an
empty text file:

-I"C:\Borland\Bcc55\include" -L"C:\Borland\Bcc55\lib;C:\Borland\Bcc55\lib\PSDK"

For the ilink32.cfg file add the following lines to
another empty text file:
-L"C:\Borland\Bcc55\lib;C:\Borland\Bcc55\lib\PSDK"

Save both these files with a .cfg extension with the appropriate name in the \Bin directory of your
compiler installation.

You will also have to add the compiler to the PATH environment variable of your system. This can be done by adding the following line to the autoexec.bat file of your system

SET PATH=C:\Borland\Bcc55\Bin;%PATH%

Once you have setup up your compiler as described in the README file open the file located in C:\Borland\BCC55\Help\bcb5tool.hlp. This is the help file from where you can get all the information regarding the compiler command line options.

 

Compiling programs with a DOS/ Command line interface

Now you can begin compiling programs using the command line. Use the following command:

bcc32 "Your c/cpp file location" 

You will now find a .exe, .obj and a .tds file in the \Bin directory of your compiler.


Compiling programs with a Win32 GUI

If you want to compile a single file program then use the following command:

bcc32 -tW "Your c/cpp file location"

The -tW switch specifies a Win32 GUI application, instead of the default console application. You can compile multiple files into a single .exe by adding the other files to the end of this command.

Linking in Resources

This is a very frustrating issue for most users and there seems to be no easy way to do it. I find the method described below to be the easiest method. Let me know if you have found an easier one.

Consider you have a file windows.cpp with its corresponding resource windows.rc. You can compile resource files as follows:

brc32 windows.rc

You will now find a windows.res file in the \Bin directory of the compiler.
Now if you want to link this resource file into your program use the following instructions:

bcc32 -c -tW windows.cpp
ilink32 -aa -c -x -Gn windows.obj c0w32.obj,windows.exe,
,import32.lib cw32.lib,,windows.res

Note: In the above example, all the arguments following the command 'ilink32' have to be issued on the same line. I have broken it up here due to space constraints.

The -c option to bcc32 means compile only, don't link into an .exe. The -x -Gn options get rid of some extra files the linker creates that you probably don't need.

Since we are manually specifying the linker command, we need to include the default libraries and objs that the compiler would normally do for us. As you can see above, The appropriate files for a regular windows application have been specified.

To make things easier on yourself, it's best to do all this in a makefile. You can download a standard and complete makefile by using the links provided at the end of this article.

You only need to modify the first 6 lines in any program you create. To use this make file copy the above lines into an empty text document, make the appropriate changes to the first 6 lines and save the file with a .mak extension. Then execute the following command:

MAKE -fwindows.mak

Here the make file is saved as windows.mak. The -f switch is used for specifying the filename of the make file. Now you will find the necessary .exe file in the \Bin directory of the compiler.'

Now you are all set to make programs with Win32 GUI's. Happy coding!!

Return to top


Downloads / Important Links:

Borland Compiler and associated help:

  • Free Borland C/C++ Compiler: Needs to further explanation.
  • Turbo Debugger: A very competent debugger made for this compiler.
  • Help Files: It is recommended that you get yourself this complete set of help files for the C++ Builder.
  • FAQ's : This is a set of well compiled frequently asked questions regarding C++ and the borland compiler.
  • Standard MakeFile: This is a standard makefile which you can use to build projects using the command line compiler. You will only need to modify the first line of this file.

Development environments:
For writing and editing source codes and editor is required. Here is a set of tools that that integrate an editor with support for driving the compiler and linker:

  • VIDE: An integrated development environment which has special support for the Borland command line compiler. It supports other languages and compilers as well. Special features: Syntax highlighting, code browsing, generation of makefiles for simple projects.
  • Emacs for Win32
  • Editplus: This is a commercial editor which extends support to a variety of programming languages. It allows you to easily configure your user tools so you can effectively create and compile C++ programs with a few clicks. Special features: Syntax highlighting, one click compilation and output window.

Websites:

Return to top


 

Have a C++ question? Share it at our forums

Add your C++ Source Codes

Join our Mailing list:
Find out more

 

In Association with Amazon.com