Working with Eclipse under Windows
This is a crash course on using the open-source Eclipse
environment under Windows. It assumes a reader who
- wants to develop in C++ or for embedded devices, like Zynq / Blackberry, not straight Java
- is familiar with some Windows IDE, like a Visual Studio
- is not well-versed in Eclipse
The modern installation of Eclipse for C++ is relatively trivial, just use
the project Europa:
http://www.eclipse.org/downloads/moreinfo/c.php. See the Gotchas section for
minor tricks if things do not work out smoothly.
At the very least, the following packages need to be installed before Eclipse
- JRE from Sun
- Cygwin gcc/gdb from
http://www.cygwin.com/setup.exe . Select fast hosts for installation (*.gov
and kernel.org 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.
The following is a list of minor problems (but major annoyances) that I have
encountered using Eclipse:
- Linker is unable to locate "WinMain@16". Solution is truly magical:
Change your main() function return value type to "int"
- GDB session cannot be established. Solution: Add c:\cygw\bin to PATH
- Eclipse cannot locate the source code. Solution: Add path mapping.
- Error message: *** target pattern contains no `%' is caused by a totally
braindamaged "fix" (excluding colons from pathnames for no other apparent
reason but the maintainer's dislike of Microsoft) in the recent Cygwin make
code. Solution: Replace the broken Cygwin file with a precompiled older
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
An idea of a project in Eclipse is quite different from
other IDEs. For example, it prefers the source files to be in the directory tree
maintained by Eclipse. 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. Some tips:
- Adding existing source files from non-Eclipse directories:
You can add files or folder from any location using links. To add a folder,
just right-click on your project->New->Folder, click on the advanced button
on the bottom, enable "Link to folder in the filesystem" and select the
folder you want to add. If you want to add just a file, right-click your
project->New->File ..., etc. The files/folders you added this way will be
marked by a little arrow (like windows shortcuts).
- Importing a makefile:
- Create a C - Makefile project (assuming the working dir of the
make is the project root folder)
- Change the project properties:
- Go to the C/C++ Build - Builder settings and uncheck "use
default build command"
- Add the command line (without the target to build) that
calls your make, e.g. c:\make\make -f makefile.mak -k
- Go to the Behaviour tab and add your targets for running
an incremental build, clean build and compile build (make sure
"Build (Incremental Build)" is checked. Otherwise the build cannot
be started at all.
- If everything is configured properly you can now run the make by
executing the menu entry Project -> Build Project
- Adding a library appears to be only possible via the
- Adding object files can only be done via "Other
objects" in Linker Build settings
Developing with Eclipse for Zynq (Standalone)
- Install the "Xilinx SDK", it includes Eclipse, drivers, etc.
- Setup the development board for using JTAG (there are typically two
switch groups, group of four shall be set 0-0-0-0, group of two shall be set
- Plug both USB cables into the front panel (the one with miniB connector
is USB serial port set to 115200 baud by default, the one with microB connector
is the JTAG)
Creating a project:
- In Eclipse, use New > Application Project. Use "Create New" for
BSP setting. Use "Helloword" option
- Edit and build the project as required. Note that the stack size is
pretty small compared to a typicl PC setup.
- Run or debug. In the run/debug configuration (select "Launch on
hardware"), connect the serial COM port to console at 115200 baud.
- Note: When adding libraries, be very careful
and use the C/C++ Build > Settings, not the visibly similar items under C/C++ General. Using
the latter to change libraries will completely mess up your project file.
Developing with Eclipse for BlackBerry
- Download the "Full Installer" from
- Follow the video,
- If, contrary to the video, the only non-grayed item under "Blackberry"
will be "Install signature keys":
- Don't try to obtain and install the keys - you most likely do not
- Instead, create a Blackberry project
- Now the things will magically start to work