ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
The wiki page was incorrect. I just fixed it. You shouldn't supply the -L
prefix when specifying a -rpath
directory to the linker.
To parse out the incantation: -Wl,foo,bar,bat,bang
tells the compiler to pass to the linker foo
, bar
, bat
, and bang
, in that order, as space-separated arguments. So when you say -Wl,-rpath,/path/to/my/lib
, the linker will get -rpath /path/to/my/lib
. And in that context, the linker doesn't want the -L
prefix on the directory (not sure whether it would behave properly or not).
And in case you're curious, the whole rpath
business is needed to allow ROS executables to depend on shared libraries that are sprinkled all throughout the package tree. Otherwise you'd have to put all the directories containing libraries in your LD_LIBRARY_PATH
environment variable. With the forthcoming rosbuild2
, we'll be moving away from explicit use of rpath
arguments, and toward a more conventional way of organizing libraries (including allowing them to be installed into a common location).
Thanks for the report.