Click here to Skip to main content
Click here to Skip to main content

Getting started with Borland C++ 5.5

, 4 Aug 2001
Rate this:
Please Sign up or sign in to vote.
In mid-February 2000 the people responsible for Borland's C++ products made the core of their product line available as a free download.
<!-- Main HTML starts here -->

In mid-February 2000 the people responsible for Borland's C++ products made the core of their product line available as a free download.

What?

They are giving away are the command-line compiler tools and libraries. These are the core of the retail Borland programming tools, like Borland C++ Builder - all the power that runs these expensive products, but without the fancy, user friendly graphical interface - you have to pay for that...

The aim of this tutorial is to get beginners up and programming in C++, easily and cheaply, using a nice friendly replacement for Borland's own expensive GUIs. I assume you are capable of downloading and installing a file by yourself, and are using some variant of Microsoft Windows.

Why?

Why would you want to use this C++ compiler?
Presumably you want to learn and use C++. This compiler is fast, free, and has the best compliance to the new (1998) ANSI C++ of any compiler out there. (Microsoft's Visual C++ is presented by Microsoft as being simply a 'Windows Compiler', so their terrible adherence to standards might be forgiven - they are still using a 1996 draft of the C++ standard...). These tools look like they run in DOS, but are full 32 bit Windows programs, and will only run in Win9x and NT. If you're a command line freak and want to compile under DOS, forget it - and use Linux.

How?

The main problem with this free C++ compiler is that it's very hard for the average computer user, brought up on Windows, to use. No buttons to click, just all sorts of magic invocations that have to be typed in by hand at the command prompt (the what?).

To overcome this learning curve a little, this tutorial will guide you through downloading and setting up the free tools, and setting up a nice friendly Windows interface to work from. We'll be using my favourite text editor, EditPlus, but other programmers' text editors can be setup in a similar fashion.

1) Get the Software

We need to download two software packages:

  1. The Free Borland C++ Compiler and Tools, and
  2. EditPlus, the text editor that's going to act as our user-friendly interface to the tools.

The text Editor's the easiest, just go to www.editplus.com, download and install the current version (about 1MB). For the purposes of this document, we are using version 2.x. EditPlus is shareware, so if you end up using it, do remember to register it.

Getting the Tools from Borland took me a long while. At the Borland website, as of February 2000 (the month this free offer started), you needed to have both cookies and Java script enabled on your browser. I had neither at first. Hopefully this situation will change, and it will all become a little easier to access. You need to go to http://community.borland.com, Register, then fill in a questionnaire before you can download anything. You should then be given a link to download the package from. It weighs in at about 8MB.

Don't install the Compiler yet, we'll cover that in the next section:

2) Setting-up the Compiler

This is the part where most new programmers will get unstuck. The instructions that come with the free Tools package are terse to say the least - not very helpful where you are unsure about how to set your 'Path Environment Variable'...

a) Install Compiler & Tools
First of all, decide where you are going to install this stuff. It'll take up to 50MB (depending on your file system - NTFS, FAT32, or FAT16) The default choice is 'C:\Borland\BCC55', and unless you have a good reason for putting it elsewhere, this is a good choice. Double clicking on the file you downloaded will take care of this part.

(If you decided NOT to install the package in C:\Borland\BCC55, substitute the full path to your chosen folder (eg. 'd:\borland') whenever I quote 'C:\Borland\BCC55' in these instructions...)

b) Configure Compiler
The installation package just copies files to your computer. You have to manually configure it to work on your system. First of all you need to add two config files to your C:\Borland\BCC55\bin directory, namely ilink32.cfg, and bcc32.cfg.

The file 'files/tutorials/bcc_config.exe' will automate this process for you, but only if you installed the tools to 'C:\Borland\BCC55\'. If you did not you will need to edit the above files manually to reflect your chosen install path, and then manually copy them into the 'bin' directory.)

c) Let Windows Know
Your compiler is now rockin', but you have to tell Windows about it. You do this by adding your 'bin' directory ('bin' for binary, or executable file...) to Windows' Path. The Path is a list of directories that Windows searches through when asked to run a command... Windows NT and Windows 95/98 differ here, so we'll break off to separate sections:

  • Windows NT/2000
    1. In the Control Panel open the 'System' applet.
    2. Go to the 'Environment' page.
    3. Halfway down the page you will find a list of User Variables.
    4. Click the 'path' variable.
    5. In the section below, you can see two edit controls, 'Variable' and 'Value'. Make sure that the variable being displayed is 'Path'.
    6. We need to add 'C:\Borland\BCC55\bin' to this. If there is already something there, type a semi-colon (;) at the end, then our installation path.
  • Windows 95/98/ME
    1. Find the file 'Autoexec.bat' (if you only have one or more files called just Autoexec, then ours is the one with an icon that looks like a Cog wheel in a blue frame).
    2. Right click the file, and choose 'Edit' from the pop-up context menu. A
    3. t the very bottom of this file type, on it's own line, the following:
      PATH=%PATH%;C:\BORLAND\BCC55\BIN

Restart your machine, and you'll be ready to...

3) Configure your Text Editor

We are going to be using the text editor you downloaded in Step one, EditPlus, a great shareware editor. It is very good at interfacing with command line tools like our free compiler, even without much configuring. The following instructions are for Version 2, but Version 1 differs only very slightly...

  1. Choose 'Tools' from the menu, then 'Configure User Tools'
  2. Click 'Add Tool'
  3. Name it BCC32 (The Compiler's chosen moniker), and browse to 'C:\Borland\BCC55\Bin\BCC32.exe'
  4. Choose 'Filename' from the list of Arguments, and 'File's Directory' as the initial directory.
  5. Make sure 'Capture Output' is ticked.
  6. The text editor is now configured as a light-weight IDE. You can invoke the compiler on your text files by pressing Ctrl+1. If you get any error messages from the compiler, you can double click on it to jump to that line in your program.
  7. If all goes well you should find an .exe file you can run in your source directory.

The Command Line Way...

The whole aim of this tutorial is to wean beginner programers away from expensive, commercial IDEs, and lead them to the powerful and FREE (if intimidating) world of command lines and open source software.

What you are doing with the text editor here is to get it to automate a few tasks for you. When you compile a .cpp file, say hello.cpp by pressing Ctrl+1 it's as if you were to type at a command prompt (sometimes called, erroneously, a DOS screen...):

bcc32 hello.cpp

That is, you run the program called bcc32, and you pass it the argument hello.cpp. Clear and simple?

4) Testing, and the FAQ

You are now able to compile simple C++ programs by simply typing 'em in and pressing Ctrl+1. Try it with the following (This is standard C++, not the C that many 'C++' tutorials will teach you...):

//  Hello World
///////////////////
#include <iostream>
using namespace std;

int main()
{
	cout << "Hello World!" << endl;
	return 0;
}

Where to from here?

You will very quickly out grow this method of programming - one file programming is only really sufficient for learning purposes. You will need to learn about make files if you want to write larger programs while sticking to free tools. IDEs such as Microsoft Visual C++ can make things seem easier, but limit you to writing platform specific programs - i.e. Windows only. Also, because they hide the way they work from you, one often finds oneself stuck trying to second guess the Microsoft programmers... That said, if you just want to learn C++, an IDE sometimes makes starting out. I can heartily recomend Devcpp, a modern free IDE for Windows.

It is possible to write programs like the trivial example above, that will compile and run on any system that has a full C++ implementation (Windows, MacOS, BeOS, Linux, Unix...), and this is an approach that I would recommend. By using the leverage of libraries, like the C++ Standard, you can quickly create powerful, multi-platform code. If you need to write platform specific code (like responding to a mouse) you can put that code in a separate file.

That in mind, here are a few texts to get you started. These are books that I own myself, and that I found to be the most useful. The first is available free on my website, and will ready you for the other, more advanced books.


Thinking in C++, Bruce Eckel
You can read, or download this whole book free. It's a really good introduction to C++, and takes you to quite an advanced level. The great thing about this book is that is deals with, and teaches the recent C++ standard, not just a whole bunch of old C constructs like many books do.


The C++ Programming Language, Bjarne Stroustrup
Bjarne invented the language, and his book remains the authoritative reference. It has been updated through a number of editions as new features are added to the language.


The C++ Standard Library, Nicolai Josuttis
By itself, C++ does not know how to write to your screen, or open a file. These indispensable functions are performed by library functions. The C++ library adds to the C library, including an implementation of the STL. This book serves as an exellent tutorial and reference.

FAQ

  • I pressed Ctrl+1 to compile the program and I got an error message saying 'could not open ilink32'
    This is by far the most common message I get regarding the tutorial. If you get this, you did not follow step (2b) properly. Reread the instructions and try again.
  • Where is my program?
    Its in the directory where you saved the source code for your program... You may want to open a command prompt (aka DOS Window), and run your program from there so that you don't get the ole' My program ran in a DOS Window for a second but closed before I had a chance to see it error...

The End...

Well, that's all folks!
Please feel free to send me some feedback. Aside from spelling and grammatical errors, I'm very interested to hear how you found the level of this tutorial. Did I labour simple points, but gloss over parts you found tricky? I'm aiming at those who're beginning to program in C++, so I do assume possession of good computer skills, and general smarts - but if you think that's you and my instructions are too hard (or easy), then please, let me know.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

About the Author

Leon Matthews
Web Developer
New Zealand New Zealand
Leon lives in Auckland, New Zealand - a city built amongst a dozen or so (hopefully) extinct volcanos. He ekes out a living there with contract work, and spends all his time thinking deeply about something or other. Despite good intentions, he is frequently late, and often gets in trouble for forgetting social appointments.
 
C++ is his favourite (computer) language, though recently he has spent most of his time writing web apps using PHP and PostgreSQL under Apache. He is very interested in improving MIQ - Machine intelligence, and playing with data compression...
 
He can be found at:
The Lost Continent of
http://www.lost.co.nz

Comments and Discussions

 
GeneralTeach Me Pinmemberwepy8888-Dec-05 19:03 
GeneralOn the Subject of IDE's Pinmemberkerbydude7-Nov-05 12:51 
GeneralCompile to win 32 application PinsussRick812-Nov-04 8:48 
GeneralRe: Compile to win 32 application PinsussAnonymous13-Mar-05 9:38 
GeneralRe: Compile to win 32 application PinmemberRick8123-Mar-05 22:56 
GeneralLinking Multible file project PinsussAnonymous18-Oct-04 12:17 
Generalabout the *.grd and *.grx files Pinmembernamazci19-May-04 3:13 
Questionwhat about .h and .cpp? Pinmemberjackieicx24-Apr-04 16:11 
AnswerRe: what about .h and .cpp? PinsussBen13626-Apr-04 4:00 
GeneralLinking Microsoft LIB files with Borland using coff2omf and ilink32 PinsussBen13617-Apr-04 11:49 
QuestionHow to compile and link a windows application using the free Borland command line tools PinsussBen13616-Apr-04 5:43 
AnswerRe: How to compile and link a windows application using the free Borland command line tools PinmemberShar13616-Apr-04 7:14 
GeneralTLIB Problem PinsussDennis Foulke9-Apr-04 10:48 
GeneralDialogBoxParam PinsussAnonymous5-Apr-04 14:38 
Questioncan i help us Pinmemberfiresw29-May-03 20:03 
AnswerRe: can i help us PinsussAnonymous6-Apr-04 11:29 
GeneralWin32 application with Borland free compiler PinmemberJosko Petric16-Sep-01 9:29 
GeneralRe: Win32 application with Borland free compiler PinmemberAnonymous24-Sep-01 7:22 
GeneralRe: Win32 application with Borland free compiler Pinsussanonymous27-Nov-02 23:27 
GeneralRe: Win32 application with Borland free compiler PinsussAnonymous14-Apr-03 8:39 
Questionhow todownlad Borland C++from the internet or from the CD PinmemberAnonymous10-Sep-01 6:51 
Eek! | :eek: Cool | :cool: Suspicious | :suss: Poke tongue | ;-P Wink | ;) Smile | :) Mad | :mad: Smile | :) Wink | ;)
AnswerRe: how todownlad Borland C++from the internet or from the CD Pinmembereckart23-Feb-03 23:24 
GeneralVIDE for BCC 5.5 PinmemberBruce Wampler31-Aug-01 5:17 
GeneralGreat IDE for Borland free compiler PinmemberM.R.30-Aug-01 6:03 
QuestionHow do I see output? PinmemberKeren13-Aug-01 3:37 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Mobile
Web04 | 2.8.140721.1 | Last Updated 5 Aug 2001
Article Copyright 2000 by Leon Matthews
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid