Log in using your OpenID or your Sol Union log in account.
[Cancel]     

C++ Language Tutorial Page 1
Compiler Set-up
Ned Bingham
Previous Index Next
Windows
     Before you can start writing code, you have to have a compiler to make an executable. Windows does not come with its own compiler so you will have to install one of your own. The easiest way to do this is with MinGW, MSys, and Eclipse. MinGW contains GNU's gcc, g++, and gdb, while MSys has basic linux commands. Eclipse is the GUI for the whole setup.

Installing MinGW:
1) Go to MinGW's downloads page.
2) Download MinGW 5.1.4 or whatever the latest version is.
3) Open the automated installer.
4) Follow the installer until it asks you to pick a package. Choose Current.
5) When the installer asks you to pick components, check everything except for make. That will be installed with MSys.
6) When the installer asks you to pick a location, it's simplest to put it at C:MinGW.

Installing MSys:
1) Download MSys either from the link provided or from the MinGW directory on source forge.
2) Go through the installer and accept all of the default options.
3) When you get to a command prompt, it will ask you to continue with a post install. type y and press enter.
4) It will then ask if you have MinGW. Respond with y and enter again.
5) Then, it will ask you for the path to MinGW. If you followed my instructions, it should be C:MinGW.
6) It should come up saying "MSys installed correctly." Press any key.
7) Finally, it should say "Setup has finished installing 'Minimal SYStem' ..." uncheck both boxes and click Finish. 8) Optionally, if you want some extra tools, install MSYS DTK 1.0.

Setting Window's Environment Variables:
1) Open System Properties in the Control Panel.
2) Click on the Advanced tab.
3) Click on Environment Variables.
4) DO NOT DELETE YOUR EXISTING ENVIRONMENT VARIABLES!
5) If you want to set the environment variables for everyone, then look for the Path variable in the System Variables section.
6) If you want to set the environment variables for just you, then look for the Path variable in the upper section.
7) Select it, and click Edit. APPEND ;C\:msys\1.0\bin;C:\mingw\bin (or whatever your paths were) to the Path variable.
8) If your environment variable is too long, Eclipse may not be able to find MinGW or MSys. To fix this, append the paths to the beginning instead of the end.

Setting Up Eclipse:
1) First, you will need Java Runtime Environment v5.0, search it on google, download it, and install it.
2) Go to Eclipse's Downloads Page.
3) Download Eclipse Classic.
4) Extract it, and move it to Program Files. If the executable doesn't launch, try to extract it using a different tool. 7-zip worked for me.
5) Once you launch Eclipse, go to the menu Help->Software Updates.
6) Click on the Available Software Tab.
7) Under the Ganymede Update Site, check the C and C++ Development.
8) Click the Install... button and follow on screen instructions.

Ubuntu Linux
     Unlike Windows, Downloading and installing a compiler for Linux is easy. You will be using the same compiler: gcc, g++, and gdb, except that this time, the software is native. Eclipse will be used for the GUI here too.

Installing gcc, g++, gdb, and make:
1) In the menu, go to System, Administration, Synaptic Package Manager.
2) Enter your password.
3) Click Search.
4) Type in gcc, find the main gcc, g++, gdb, and make packages and click install.
5) If asked about installing dependancies, make sure to say yes.
Setting Up Eclipse:
1) Install JRE 5.0 the same way you did gcc, g++, gdb, and make.
2) Go to Eclipse's Downloads Page.
3) Download Eclipse Classic 3.4.1.
4) Extract it, and move it to the Desktop.
5) Once you launch Eclipse, go to the menu Help->Software Updates.
6) Click on the Available Software Tab.
7) Under the Ganymede Update Site, check the C and C++ Development.
8) Click the Install... button and follow on screen instructions.

Max OS X
     Mac is a little odd. First check to see whether you have a compiler. Open Terminal and type gcc --version, if it comes up with a version number, you are good. Next, check to see if you have Xcode, it should be /Developer/Applications/Xcode.app. If you do not have either one of these things, you will have to install Developer Tools. This is located both on your install disks and, if you are a member, at the ADC Member Site .