Getting Eclipse for C/C++ Development Go to www.eclipse.org and click on Download Eclipse: Select the Eclipse IDE for C/D++ development: Download the distribution: Unzip the distribution in an appropriate location. If you’ve already got Eclipse for Java installed, I recommend placing this in a different directory tree, say eclipsecpp. CS@VT August 2009 ©2009 McQuain
Creating a C Project for Cygwin Start Eclipse CS@VT August 2009 ©2009 McQuain
Creating a C Project for Cygwin Start Eclipse and select File/New/C Project: CS@VT August 2009 ©2009 McQuain
Creating a C Project for Cygwin Enter a name for your Eclipse project… choose a location for it if you like… and select Empty Project. Click on Next… CS@VT August 2009 ©2009 McQuain
Creating a C Project for Cygwin Click on Advanced settings… CS@VT August 2009 ©2009 McQuain
Configuring the C Project Expand the C/C++ Build tree, select Settings, and select Cygwin C Compiler… In the Command text box, enter gcc-4 as shown… CS@VT August 2009 ©2009 McQuain
Configuring the C Project Select Miscellaneous and edit the Other flags box to include –std=c99: Note: in most cases, settings like this require exactitude… do not add or omit spaces. CS@VT August 2009 ©2009 McQuain
Configuring the C Project Select Cygwin C Linker… in the Command text box, enter gcc-4 as shown… Click OK… and then Finish… CS@VT August 2009 ©2009 McQuain
Adding a C Source File The Eclipse project has been created… now it’s time to add a source file: CS@VT August 2009 ©2009 McQuain
Adding a C Source File Choose a name the source file: You can leave the Template setting alone, or experiment with it as you like… CS@VT August 2009 ©2009 McQuain
Adding a C Source File Now you’ve got a nearly-empty source file: CS@VT August 2009 ©2009 McQuain
Editing the Source File Add the source code as shown below: CS@VT August 2009 ©2009 McQuain
Performing a Build Use the Project menu or click on the build button (the hammer icon): CS@VT August 2009 ©2009 McQuain
Checking the Build Results Select the Console window and view the results of the build: The given source code was designed to test whether you’ve configured the project properly. If not, the build will fail, since it requires compatibility with the C99 Standard. CS@VT August 2009 ©2009 McQuain
Setting the Run Configuration Select the Run Configurations option from the Run menu: CS@VT August 2009 ©2009 McQuain
Setting the Run Configuration Double-click on C/C++ Application… Click Browse for the Project entry and select the current project… Click Search Project for the C/C++ Application entry and select HelloWorld.exe: Click Apply and Close… CS@VT August 2009 ©2009 McQuain
Executing the Program Click the Run button… Output from printf() appears in the Console window. CS@VT August 2009 ©2009 McQuain