0
$\begingroup$

Rosanswers logo

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


Originally posted by andreas on ROS Answers with karma: 168 on 2012-03-09

Post score: 1

$\endgroup$

5 Answers 5

0
$\begingroup$

Rosanswers logo

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.


Originally posted by Kadir Firat Uyanik with karma: 288 on 2012-03-10

This answer was NOT ACCEPTED on the original site

Post score: 1


Original comments

Comment by andreas on 2012-03-11:
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.

Comment by andreas on 2012-03-11:
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

$\endgroup$
0
$\begingroup$

Rosanswers logo

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


Originally posted by andreas with karma: 168 on 2012-03-11

This answer was ACCEPTED on the original site

Post score: 7


Original comments

Comment by prince on 2012-03-13:
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.

Comment by Mario Garzon on 2012-06-14:
it also worked for me, by launching from a terminal shell, but only on FUERTE projects, any ideas why?

Comment by prince on 2012-06-18:
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.

$\endgroup$
0
$\begingroup$

Rosanswers logo

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
  • Add 'set(CMAKE_VERBOSE_MAKEFILE TRUE)` in your CMakeLists.txt

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.


Originally posted by Daniel Stonier with karma: 3170 on 2012-03-13

This answer was NOT ACCEPTED on the original site

Post score: 2

$\endgroup$
0
$\begingroup$

Rosanswers logo

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

Originally posted by dgossow with karma: 1444 on 2012-04-24

This answer was NOT ACCEPTED on the original site

Post score: 10


Original comments

Comment by ubuntuslave on 2012-04-25:
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.

Comment by felix k on 2012-04-25:
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.

Comment by Mario Garzon on 2012-06-20:
i think the bash -i -c eclipse is the easiest way to solve the problem!! thanks a lot

Comment by georgebrindeiro on 2013-01-28:
awesome answer, thanks!

Comment by cf.morales46 on 2013-02-20:
Worked for me using bash -i -c eclipse on groovy. Thanks a lot!

$\endgroup$
0
$\begingroup$

Rosanswers logo

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.


Originally posted by Jon with karma: 115 on 2012-07-23

This answer was NOT ACCEPTED on the original site

Post score: 3

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.