C++ Compiler Notes
Quick Links
If you already know about the compilers for this class, select from the quick links below.
Otherwise, read the notes that follow them first.
- How to Download and Install the Dev C++ Compiler: Read a PDF Document.
- Direct link to download the [Dev C++ 4.9.9.2 with Mingw/GCC] (9.0 MB compressed self-extracting archive) for installation on PC's.
- Direct link to download the [Dev C++ 4.9.9.2 Portable Version 4 with Mingw/GCC] (11.4 MB compressed self-extracting archive) for installation on USB devices. For instructions about downloading and installing this portable USB version of the compiler read the linked PDF Document.
- Using a C++ Compiler to Create a Program:
Notes
A compiler is a program that translates source code into object code (machine language instructions). Students in this course have many different compilers available to choose from. You are not locked into any one choice, although you might find it easier to learn just one in the beginning and then evaluate others when you are comfortable working with your first choice. The following issues will affect your decision:
- Working platform. If you plan to develop your programs on a Windows-based PC, then you will need to find a C++ compiler that runs on a Windows-based PC.
- Target Platform. The term "platform" indicates both the family of processor in a computer and the specific operating system used to control it. A program does not have to be developed on the same platform that it will run on; but that is generally the easist approach. A compiler program translates source code into object code for a specific family of processors. The new program is typically intended to run under a specific operating system, such as Windows 7 or Linux Fedora 15. For example, programs intended to run on a 32-bit Intel-based PC using Windows 7 are easiest to test when developed on the same platform. If you have a 64-bit processor in your PC, but want to develop a program to run on a 32-bit processor, you will have to be sure that your compiler can translate your source code into object code for a 32-bit processor.
- Simplicity vs. Sophistication. In addition to performing translation functions, compilers also typically provide a text editor for writing source code and a "linker/loader" that combines all of the pieces (object code files) of a program together to create a single executable program file. Some more sophisticated compilers also include diagnostic features to assist in finding program errors. Compilers with all of these features are known as "integrated development environments (or IDE's)". Simple IDE's allow programmers to develop simple programs with only a few (or just one) module. More sophisticated IDE's allow (but also require) programmers to create and manage all of the pieces comprising entire programming "projects". There more sophisticated the software, the more complex it is to install and use. So unless, you need the complexity, try a simpler version.
- Cost. The multitude of free, high quality C++ compilers available on the Internet makes a choice to use a commercial compiler unlikely unless you already have one, especially because the commercial compilers are typically large and complicated. You can find a wide assortment of free C++ compilers compilers discussed and available for download on the pages: [Free C/C++ Compilers] or by doing an Internet search on the phrase "free C++ compilers review".
The list below describes a few compiler choices typically made by students in this course.
- Some students choose to purchase and use Microsoft® Visual Studio® 2010 because the college has a copy of this commercial package (which includes a C++ compiler) already installed on the computers in our classrooms. However, such a purchase is not necessary because Microsoft offers (on their web site) a simpler free version of this program named [Microsoft® Visual Studio® 2010 Express]. The simpler Express version is sufficient for all work we will do in this class, but still might be more complicated than desired for some students.
- An alternative preferred by your instructor is to use the free compiler named [Dev C++] from a software developer [oddly named Bloodshed.Net]. This older IDE is much simpler to use, but lacks some of the features found in more modern compilers. Nevertheless, it is more than sufficient for this class.
- Along with the two options above, your textbook's author also recommends the following free compilers:
Each has its admirers and critics. But again, any of these are more than sufficient for this class.
- The compiler of choice for most users of the Linux operating system is the [GNU C++ Compiler (GCC)], although many others are available too. Linux is primarily a console-based environment. So GCC is a command-line compiler rather than a point-and-click GUI.
- Most Mac users recommend the G++ compiler which is part of the free [Xcode] package. There is also a version of [Eclipse™] for the Mac.
Students registered in face-to-face sections of the course will have the opportunity to
practice downloading and installing Dev C++ software in the classroom.
Distance learning students who require assistance beyond the posted tutorials can visit my
office during office hours or receive help on the phone.
If desired, students can then download and install the free software on their own computers
and work on their program coding projects at home. Alternatively, students can come into the
computer labs during their posted hours of operation and use the Microsoft Visual C++ software
on the lab computers.
Many C++ compilers can be found on the Web. The language is highly "transportable",
meaning that it can run on many different hardware platforms. For this reason, you often find
the compiler software stored in its original source code rather than as an executable program
written for a specific computer. In such circumstances, after downloading the software you have
to know how to prepare it for execution on your own style of machine.
The easier alternative is to find an executable version of the compiler that has already been
prepared for your style of computer and operating system (such as Windows 7 or Linux) and download that.
Macintosh users should look at the
[Macintosh Programmer's
Workshop (MPW)], a comprehensive collection of development tools designed to support C,
C++, and assembly-language programmers who are writing software for Mac operating systems.
Remember that you can author your C++ source code using any text editor (such as Windows Notepad),
as long as you save the file in ASCII ("text") format with a filename extension of ".cpp".
A compiler is required only to translate and link your code into an executable program.
This can be done after your source code is written and saved on a storage device.
Return to the top of this page to select a quick link.