# Eclipse ROS fuerte

Hi guys,

I did exactly as described here http://www.ros.org/wiki/IDEs to import my ROS package to Eclipse. It compiles and runs without problems using the shell, but when using "Build Project" in Eclipse I only get:

/usr/bin/make all
rospack: error while loading shared libraries: librospack.so: cannot open shared object file: No such file or directory
Makefile:1: /cmake.mk: No such file or directory
make: *** No rule to make target /cmake.mk'.  Stop.


I don't see where the problem is. I checked the environment variables and they are fine.

Cheers, Andreas

edit retag close merge delete

Sort by » oldest newest most voted

When starting eclipse from the shell it worked. Otherwise it seemed to ignore the environment variables.

more

1

It makes sense as bash environment provides required environment varibles. It always works. The problem sometimes we face are indexer problems because indexer could not get the path to header files. This is easily resolved by adding path to relevant libraries.

( 2012-03-13 17:57:54 -0600 )edit

it also worked for me, by launching from a terminal shell, but only on FUERTE projects, any ideas why?

( 2012-06-14 01:44:44 -0600 )edit

I am still using diamondback and electric variants. The procedure always work fine for me. I can not offer justification for "why only for FUERTE projects ...". Also I had still not installed FUERTE, so my system still holds good for packages belonging to diamondback and electric variants.

( 2012-06-18 01:34:48 -0600 )edit

I had the same problem, changing my launcher to source setup.bash solved it.

Create a file called "Eclipse.desktop" and paste the below text into it, possibly replacing /opt/eclipse with wherever your Eclipse installation is located.

#!/usr/bin/env xdg-open

[Desktop Entry]
Version=1.0
Type=Application
Terminal=false
Icon[en_US]=/opt/eclipse/icon.xpm
Exec=bash -c "source /opt/ros/fuerte/setup.bash; /opt/eclipse/eclipse"
Name[en_US]=Eclipse
Name=Eclipse
Icon=/opt/eclipse/icon.xpm

more

I can confirm such a configuration for launching Eclipse Indigo from an icon in Ubuntu 11.10 (Oneiric) and using ROS Fuerte gets rid of the problem.

( 2012-04-25 11:01:48 -0600 )edit
6

bash -i -c eclipse is sufficient, it starts bash in interactive mode, which per definition sources the .bashrc, therefore being consistent with the ros distro and other configs defined there.

( 2012-04-25 23:14:05 -0600 )edit
1

i think the bash -i -c eclipse is the easiest way to solve the problem!! thanks a lot

( 2012-06-20 03:50:56 -0600 )edit

( 2013-01-28 07:58:55 -0600 )edit

Worked for me using bash -i -c eclipse on groovy. Thanks a lot!

( 2013-02-20 11:06:27 -0600 )edit

I had problems compiling ROS packages in Eclipse and found that adding the variable "LD_LIBRARY_PATH=/opt/ros/fuerte/lib" to the existing variables (ROS_PACKAGE_PATH, ROS_ROOT, PYTHONPATH, PATH) in "(Project)Properties->C/C++ Make Project->Environment" fixed the problem.

more

We typically do not use eclipse projects in eclipse for ros. Makefile projects seem to work well and require almost no configuration.

• Create your ros package (with roscreate-pkg)
• Start eclipse from your ros shell (or in a bash script which calls setup.bash first).
• Create a new empty makfile c++ project rooted at your project

The last point helps the indexer auto-find headers because it will track all the -I flag settings that ros's make target generates.

• Finally build and clean using the default build/clean options.

You can then get creative by adding make targets in the ide for tests etc.

more

Are you sure you set the relevant environment variables under (Project)Properties->C/C++ Make Project->Environment too?

As far as I know Eclipse may not reach environment variables, such as ROS_PACKAGE_PATH, ROS_ROOT, PYTHONPATH, PATH. And you should add these manually.

I'm sure there should be a more elegant solution so that they can be added automatically, but this worked for me every time.

more

Yes, the variables are all there PATH: /opt/ros/fuerte/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games ROS_ROOT: /opt/ros/fuerte/share/ros PYTHONPATH:/opt/ros/fuerte/lib/python2.6/dist-packages: and the package path.

( 2012-03-11 22:54:45 -0600 )edit

Yes, the variables are all there PATH: /opt/ros/fuerte/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games ROS_ROOT: /opt/ros/fuerte/share/ros

( 2012-03-11 22:54:47 -0600 )edit

Sorry - I cannot just leave comments on an answer, so this is directed to doml25.

Can you clarify what you mean? I am having the same issue with Fuerte and Juno - I created a package in /ros_workspace. Then I created a new Eclipse workspace in /ros_workspace. I imported the package into the Eclipse workspace, but still am getting "/cmake.mk: No such file or directory". I tried creating an Eclipse workspace within the already-created package space, but that failed even more miserably.

BTW - can anybody tell me where this commenting tool is?

more

OK - I have a commenting tool on my answer, but not on anyone else's.

( 2012-07-23 09:33:25 -0600 )edit

To clarify for khambuch: I used the solution provided by dgossow and the problem still persisted. At that time when I opened eclipse I used ~/workspace as my workspace while the Ros Project was in the directory ~/ros_workspace. I imported the project into eclipse without copying the files.

When I closed eclipse and re-opened it selecting ~/ros-workspace as my workspace and then importing the project into eclipse everything worked.

Eclipse saves its configuration inside the directory you choose for a workspace. By switching workspaces, I forced eclipse to establish a new configuration and then it worked as expected.

more

I encountered the same problem today using Eclipse Juno and ROS Fuerte on a Ubuntu system. I tried the solutions by dgossow and snorri, neither worked.

After reading some more about eclipse it hit me. The problem was that my eclipse juno install started with a workspace of ~/workspace but my ROS project was located in ~/ros_workspace. Once I restarted eclipse with a workspace of ros_workspace I was able to successfully build my project.

I believe this problem is unique to Eclipse Juno and ROS Fuerte, as I have another computer running Eclipse Indigo and ROS Electric without this problem.

more