Getting started with eclipse

Eclipse is a very powerful IDE. These pages are intended to get you started. The help-facility of eclipse is comprehensive and will give you further information.

The IDE is started via the command-line - simply type eclipse & at a command-line prompt.

Eclipse starts by default with settings suitable for writing Java programs. To select the settings suitable for C/C++, open Window -> Open Perspective -> Other and select C/C++.

To create a new project, open File-> New-> Managed Make C Project , enter a name for the project and otherwise accept the default options. After these steps you should get a screen that looks like
New Project layout

You create a new (empty) source file by opening File-> New -> Source File and entering the file name. You can now start entering your source code. The program for the Hello-World-example looks like this:

With the default settings, the project will be automatically compiled as soon as it is saved (via the obvious button in the toolbar). Errors are indicated in the subwindows entitled "Problems" - see the example below.
Compiler errors
The subwindows "console" gives the detailed output of the compiler.

To run the program, open Run-> run and select the current project and the binary in the current project in the Main-Tab. Arguments to the program may be typed into the Arguments-tab. The output will appear in the console-subwindow.

To run the debugger, open Run-> ; Debug. If you have run the program before, all the options should be fine, otherwise you need to select the correct program to debug. The dialogue is the same that appears when you run the program. There is a subwindows "Variables" which shows the current value of all variables.

To set breakpoints, go into debug mode, put the cursor on the line where you want to set the breakpoint, and select Run-> Toggle Line Break Point. After the program stops, seelct Run-> Resume to resume execution.