ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

I wouldn't recommend using rpath. The code is not portable and it quickly becomes hard to maintain it. ROS imports the libraries that one stores in the lib path, so you can have yours there. Alternatively you can set LD_LIBRARY_PATH to add paths to the loader search list. This can be easily done in a launch file too!

I wouldn't recommend using rpath. The code is not portable and it quickly becomes hard to maintain it. ROS imports the

The libraries that one stores in the lib path, so folder of a package will be discoverable by the linker when you compile your own package. Say for example you have package A, with the folder lib and the library libfoo.so. Then if you write package B which depends (in the manifest.xml) on A, any executable in B will link against the libraries in A/lib. To check this, you can have yours there. type:

ldd your_executable

and see the dependencies in /opt/ros.

Alternatively you can set LD_LIBRARY_PATH to add paths to the loader search list. This can be easily done in a launch file too!by using:

$(env ENVIRONMENT_VARIABLE)

For more information see the roslaunch xml format.

I wouldn't recommend using rpath. The code is not portable and it quickly becomes as the path to the shared libraries is hard to maintain it. coded in the executable.

The libraries in the lib folder of a package will be discoverable by the linker when you compile your own package. Say for example you have package A, with the folder lib and the library libfoo.so. Then if you write package B which depends (in the manifest.xml) on A, any executable in B will link against the libraries in A/lib. To check this, you can type:

ldd your_executable

and see the dependencies in /opt/ros.

Alternatively you can set LD_LIBRARY_PATH to add paths to the loader search list. This can be easily done in a launch file by using:

$(env ENVIRONMENT_VARIABLE)

For more information see the roslaunch xml format.