Working with Eclipse under Windows
This is a crash course on using the open-source Eclipse environment under
Windows.
Installation
At the very least, the following packages need to be installed to work with
C/C++ under Eclipse
- JRE from Sun (I used
1.4.2), as the IDE is mostly Java-based
- Eclipse SDK (I used 3.0.1) . This is a large
download (> 80 MB).
Just unpack it into whatever directory you like (it is not afraid of spaces in
filenames, so Program Files\Ecl worked in my case) . Note that since no actual
installation is involved, no icons are created automagically.
- C/C++ Add-on (I used 2.0.2). Use Update feature in Help menu of
Eclipse, explicitly specify
http://update.eclipse.org/tools/cdt/releases/new as a new URL.
- Cygwin gcc/gdb from
http://www.cygwin.com/setup.exe . Select fast hosts for installation (.gov
work well for me in the US), install stuff from Base and Devel sections.
Install Cygwin into a directory that does not contain spaces in
the name (\cygw works for me). Add this directory to PATH environment
variable - otherwise Eclipse will not find the tools.
Perspectives
All IDEs use multiple window configurations for different tasks, like editing
and debugging. In Eclipse, this process is made explicit via "perspectives" -
stored window configuration layouts. Eclipse likes to ask questions if it is OK
to change to a new perspective - in my experience, answer shall always be "yes".
The perspectives can be switched via a selector in the top right corner of the
IDE. So, if you are wondering where all your editing screens have gone after a
debugging session, don't worry - they are only a click away
☺.
Active Project
Unfortunately, Eclipse does not have a notion of "active project" similar to
other IDEs. If one is not careful, it is very easy to build or execute a wrong
project in a multi-project environment. Some hints:
- Run As / Debug As selection work with the project currently selected in
the project pane
- After the first debug / run, additional options in the corresponding menus
will point to projects to debug or build
- I gave up trying to figure how to build projects without running them
☺
Eclipse community is discussing introduction of an active project notion.
Unfortunately, the C/C++ projects apparently go somewhat against the grain of
"sea of classes" in Java, and therefore are hard to graft onto primarily
Java-oriented culture of core Eclipse developers.