setting up eclipse computer organization i 1 cs@vt august 2009 ©2009 mcquain getting eclipse for...

14
Setting up Eclipse Computer Organization I 1 CS@VT August 2009 ©2009 McQuain Getting Eclipse for C/C++ Development Go to www.eclipse.org and click on Download Eclipse: Select the Eclipse IDE for C/C++ 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.

Upload: paulina-price

Post on 16-Jan-2016

219 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Setting up Eclipse Computer Organization I 1 CS@VT August 2009 ©2009 McQuain Getting Eclipse for C/C++ Development Go to  and click on Download

Setting up Eclipse

Computer Organization I

1

CS@VT August 2009 ©2009 McQuain

Getting Eclipse for C/C++ Development

Go to www.eclipse.org and click on Download Eclipse:

Select the Eclipse IDE for C/C++ 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.

Page 2: Setting up Eclipse Computer Organization I 1 CS@VT August 2009 ©2009 McQuain Getting Eclipse for C/C++ Development Go to  and click on Download

Setting up Eclipse

Computer Organization I

2

CS@VT August 2009 ©2009 McQuain

Creating a C Project for Cygwin

Start Eclipse

Page 3: Setting up Eclipse Computer Organization I 1 CS@VT August 2009 ©2009 McQuain Getting Eclipse for C/C++ Development Go to  and click on Download

Setting up Eclipse

Computer Organization I

3

CS@VT August 2009 ©2009 McQuain

Creating a C Project for Cygwin

Start Eclipse and select File/New/C Project:

Page 4: Setting up Eclipse Computer Organization I 1 CS@VT August 2009 ©2009 McQuain Getting Eclipse for C/C++ Development Go to  and click on Download

Setting up Eclipse

Computer Organization I

4

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…

Page 5: Setting up Eclipse Computer Organization I 1 CS@VT August 2009 ©2009 McQuain Getting Eclipse for C/C++ Development Go to  and click on Download

Setting up Eclipse

Computer Organization I

5

CS@VT August 2009 ©2009 McQuain

Creating a C Project for Cygwin

Click on Advanced settings…

Page 6: Setting up Eclipse Computer Organization I 1 CS@VT August 2009 ©2009 McQuain Getting Eclipse for C/C++ Development Go to  and click on Download

Setting up Eclipse

Computer Organization I

6

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…

Page 7: Setting up Eclipse Computer Organization I 1 CS@VT August 2009 ©2009 McQuain Getting Eclipse for C/C++ Development Go to  and click on Download

Setting up Eclipse

Computer Organization I

7

CS@VT August 2009 ©2009 McQuain

Configuring the C Project

Select Miscellaneous and edit the Other flags box to include –std=c99:

Page 8: Setting up Eclipse Computer Organization I 1 CS@VT August 2009 ©2009 McQuain Getting Eclipse for C/C++ Development Go to  and click on Download

Setting up Eclipse

Computer Organization I

8

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…

Page 9: Setting up Eclipse Computer Organization I 1 CS@VT August 2009 ©2009 McQuain Getting Eclipse for C/C++ Development Go to  and click on Download

Setting up Eclipse

Computer Organization I

9

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:

Page 10: Setting up Eclipse Computer Organization I 1 CS@VT August 2009 ©2009 McQuain Getting Eclipse for C/C++ Development Go to  and click on Download

Setting up Eclipse

Computer Organization I

10

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…

Page 11: Setting up Eclipse Computer Organization I 1 CS@VT August 2009 ©2009 McQuain Getting Eclipse for C/C++ Development Go to  and click on Download

Setting up Eclipse

Computer Organization I

11

CS@VT August 2009 ©2009 McQuain

Adding a C Source File

Now you’ve got a nearly-empty source file:

Page 12: Setting up Eclipse Computer Organization I 1 CS@VT August 2009 ©2009 McQuain Getting Eclipse for C/C++ Development Go to  and click on Download

Setting up Eclipse

Computer Organization I

12

CS@VT August 2009 ©2009 McQuain

Editing the Source File

Add the source code as shown below:

Page 13: Setting up Eclipse Computer Organization I 1 CS@VT August 2009 ©2009 McQuain Getting Eclipse for C/C++ Development Go to  and click on Download

Setting up Eclipse

Computer Organization I

13

CS@VT August 2009 ©2009 McQuain

Performing a Build

Use the Project menu or click on the build button (the hammer icon):

Page 14: Setting up Eclipse Computer Organization I 1 CS@VT August 2009 ©2009 McQuain Getting Eclipse for C/C++ Development Go to  and click on Download

Setting up Eclipse

Computer Organization I

14

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.