1.1. Obtaining and Installing GCC
Problem
You wish to obtain GCC, the free GNU C/C++ compiler.
Solution
The solution depends on your operating system.
Windows
Install MinGW, Cygwin, or both.
To install MinGW, go to the MinGW homepage, www.mingw.org, and follow the link to the MinGW download page. Download the latest version of the MinGW installation program, which should be named MinGW-<version>.exe.
Next, run the installation program. It will ask you to specify where you want to
install MinGW. It may also ask you which packages you wish to install; at a minimum, you
must install gcc-core, gcc-g++, binutils, and the MinGW
runtime, but you may wish to install more. When the installation is complete, you will
be able to run gcc, g++, ar, ranlib, dlltool, and several other
GNU tools from the Windows command line. You may wish to add the bin subdirectory of your MinGW installation to your
PATH environment variable so that you can specify
these tools on the command line by their simple names rather than by their full
pathnames.
To install Cygwin, go to the Cygwin homepage, www.cygwin.com, and follow the link “InstallCygwin Now” to download the Cygwin installation program. Next, run the installation program. It will ask you to make a series of choices, such as where Cygwin should be installed.
Tip
I’m explaining the Cygwin installation process in detail because it can be a bit complicated, depending on what you want to install. The process may have changed by the time you read this, but if ...