Saturday, August 30

Portable C/C++ Compiler and IDE Setup

Our Advanced CS class had decided to learn C/C++ and use it as our language of choice during the year. Knowing a bit already, I took it upon myself to find a suitable IDE for Windows - and, since I like to work on projects on any available school computer, it had to be completely portable. In the end, Code::Blocks seemed the simplest, fastest, and easiest to carry around. What more could you ask?

Instructions to install Code::Blocks and the MinGW compiler:

1. Visit the Code::Blocks download page.
2. Select "Download the binary release."
3. Scroll down to the downloads for Windows 2000 / XP / Vista / 7.
4. Download "codeblocks-13.12mingw-setup.exe" by clicking on the link to Sourceforge.net. The version "13.12" may have been superseded by a more recent version.
5. The installer should automatically download.
6. Continue with section (A) or (B).

(A) If you want to run Code::Blocks from only one computer:

7. Run the installer you just downloaded. It may require administrator privileges.
8. Click through each step; the default values should work fine.
9. You're done!

(B) If you want to run Code::Blocks and MinGW from a flash drive:

7. Run the installer you just downloaded. It may require administrator privileges.
8. Click "Next" and then accept the license agreement.
9. On the next page, select a "Standard" install instead of the default "Full" install (this is going to be put on a portable flash drive with limited space, after all). Continue.
10. Choose your flash drive as the install location, then click "Install."
11. You're done!

Note that Code::Blocks saves its settings in %APPDATA% on the current computer, which means that it won't keep any settings when you transfer it between computers. I chose not to include instructions to fix this because doing so means Code::Blocks won't automatically detect MinGW on the flash drive. Read: you'll have dialogs appear at startup on every new computer, but everything will work.

Also: don't run the portable install on any computer that already has Code::Blocks installed. It will find the extant configuration file that points to a different compiler location and get confused; you'll have to run the automatic compiler finder from the settings menu again. So just use the local copy.