If you are running linux, you should have everything you need to run
g++.
*All you need to do is type:
g++ -Wall input.cpp -o input
If you are running windows, you'll need to download and install
MinGW.
*Be sure to install the g++ and make options.
The following tools can help you make coding in windows easier:
- Command Window Here - Windows XP Program to allow right-clicking on a folder and opening a command window
- Syn - Alternative Windows Text Editor with Highlighting
Installation
Setting Your Path
Windows has a variable called
PATH which is uses to search for programs like g++.
- Click Start
- Control Panel
- Dbl-Click System
- VISTA: Click Advanced System Properties on the left
- Click Advanced Tab
- Click Environmental Variables Button
- Click on PATH
- Click on Edit Button
- *Add a semi-colon ; and the path to the directory of MinGW bin (default is c:\MinGW\bin)
- Click OK
- Click OK
- Click OK
You may also need to reboot before this will take effect.
Setting Up Syn
Syn can be setup to add a "Send To" link in your right-click menu. This is recommended.
Getting Syn to Compile
- Go to Run Menu
- Go to Run File then Configure
- Click the ... next to Profile
- Click add and type C++ as a name for the profile
- Click OK
- Click the Add Program Button
- Type in g++ where it now says New Program
- Program: C:\MinGW\bin\g++.exe
- Arguments: -W -Wall "$[ActiveDocLong]" -o "$[ActiveDocLongNoExt].exe"
- Directory: $[ActiveDocPathShort]
You can now hit F9 to compile your program. A command line box will pop-up displaying the result.
Running Your Program
Use windows explorer to go to the directory where your program is stored. Right-click on the directory and select
"Open Command Window Here".
*In Vista, You have to click the directory in the right-side pane while
holding the shift key.* You should now have a dos prompt with your directory containing your newly
created .exe file. Type in the name of your .exe file and hit return. Voila!