Freely Available C++ Compilers for Windows

One problem with learning C++ under Windows is that commercial compilers cost an arm and a leg.  They provide a lot of benefits, too, such as a graphical IDE, an integrated source debugger, and online help and documentation.  However, if you just want a basic compiler so you can explore C++, or if you are looking for a more standards-compliant compiler than the one you've got, you may want to take a look at GNU C++ and/or Borland's BCC 5.5. Each of these is fairly standards-compliant (at least more than Microsoft Visual C++.)

GNU C++ (Cygwin)

GNU C++ is an open source, free compiler for C++.  Cygnus is a company that provides support and tools for GNU C++ (it's now part of Red Hat).  They have a freely available, easily installed version of Cygnus/GNU C++ for MS Windows available from Look for the "setup.exe" link on that page; download it and install it. This also give you a Unix-like bash shell under Windows.

Note: If you get "out of environment space" under win95/98 when running the shell, you need to increase the environment variable space for this program.
a) Go to the window menu (upper left corner, looks like an icon) and choose the Properties menu item
b) Go to the Memory tab, and increase the Environment setting to the maximum (4096 on my machine).
c) Close the Cygwin B20 window and go back to step 3.

To try this out, ceate a simple "Hello World" program in your favorite editor, and compile it:

g++ hello.cpp

The resulting executable will be named "a.exe".  You can run the program with "./a" from within the bash shell.

Note: Cygnus also has a freely available debugger (Insight) and a collection of other tools.


Recently, Borland/Inprise has made their command-line compiler available for download at  They make you go through a signup process, but it's not too bad.  Follow the links and fill in the fields, and eventually you will get to a page that lets you download an installation executable (7.8 megabytes).

Note that this does not give you the C++Builder IDE, debugger, etc.  However, it does give you the core C++ compiler which is fairly standards-compliant.  It should also let you create Windows graphical applications fairly easily (given that you are willing to write to the Windows SDK or find your own class library). I have been told that there is a free debugger available from Borland's site as well but have not tried it myself.