Eclipse usage with RidgeRun SDK

From RidgeRun Developer Connection
Jump to: navigation, search

This is a work in progress.

Uninstall Ubuntu version of Eclipse

We will use the latest release from Eclipse Foundation.

sudo apt-get remove   eclipse-jdt  eclipse-pde  eclipse-platform  eclipse-platform-data  eclipse-plugin-cvs  eclipse-rcp

Install Ubuntu version of OpenJDK

sudo apt-get install openjdk-6-jre

Install Eclipse Foundation version

cd /usr/share/
sudo tar -xzf $HOME/Downloadseclipse-*.tar.gz

Running Eclipse

I added a simple script to my $HOME/bin directory (that directory is in my PATH):

Adding directory to path:

Create the directory:

mkdir $HOME/bin

Add the directory to the PATH, adding the following lines at the end of .bashrc:

PATH=$PATH:$HOME/bin/
export PATH
echo 'PATH=$PATH:$HOME/bin' >> ~/.bashrc

Now you can create the help script to start Eclipse with the right parameters:

echo '/usr/share/eclipse/eclipse -vmargs -Xmx1024M $* &' > $HOME/bin/eclipse
chmod ugo+rx $HOME/bin/eclipse

Run Eclipse using

eclipse

Install GNU ARM Eclipse Plug-in

In Eclipse

Importing existing Eclipe project into workspace

In Eclipse:

  • File-> Import
    • General (clickon plus icon to expand tree menu)
      • Existing Projects into Workspace

Path variables

There are two paths that if you set as Eclipse build variables, then when you create additional DEVDIRs, you will not be hard coded to your first install.

  • Project -> Properties, C/C++ Build, Environment
    • FSDEV_LOC = ${WorkspaceDirPath}/fs/fsdev
    • TOOLCHAIN_LOC = /opt/codesourcery/arm-2009q1

Specifying path to GNU executables

For the GNU tools, assembler, C compiler C++ compiler linker, and related helper tools (objdump, etc) specify the Command line pattern as

${TOOLCHAIN_LOC}/bin/${COMMAND}

in the Tool Settings tab, Expert settings, in the top level setting configuration tree for the four tools.

Specifying headers

When your application or library that you are managing under Eclipse uses a library that is built by the RidgeRun SDK, you need to tell the compiler where to find the library headers.


  • Project -> Properties, C/C++ Build -> Settings -> Tool Settings -> ARM Sourcery Linux GCC C++ Compiler -> Directories
    • ${FSDEV_LOC}/usr/include
    • ${FSDEV_LOC}/usr/include/glib-2.0
    • ${FSDEV_LOC}/usr/lib/glib-2.0/include
    • ${FSDEV_LOC}/usr/include/gstreamer-0.10

Those are some examples. You can add your dependent library header list as needed.

Specifying libraries

When your application or library that you are managing under Eclipse uses a library that is built by the RidgeRun SDK, you need to tell the linker where to find the libraries:

  • Project -> Properties, C/C++ Build -> Settings -> Tool Settings -> ARM Sourcery Linux GCC C++ Linker -> Libraries
    • glib-2.0
    • gthread-2.0
    • gmodule-2.0
    • gstbase-0.10
    • gobject-2.0
    • gstapp-0.10
    • gstreamer-0.10
    • z

Those are some examples. You can add your dependent library list as needed. The Library search path (-L) should be set to:

  • ${FSDEV_LOC}/usr/lib

or similar depending on where your libraries of interest where installed.