rosrun on mac error: dyld: Library not loaded: librospack.dylib
I have build ros on mac ,and I the cmd rescore run normally. but rosrun can`t work. for example: I have google this problem https://github.com/mikepurvis/ros-install-osx/issues/12 other people meet the same problem
[#2#zouxidong@23:12:08 ~]$ rosrun rviz rviz
dyld: Library not loaded: librospack.dylib
Referenced from: /Users/baidu/ros_catkin_ws/install_isolated/bin/rospack
Reason: image not found
find: ftsopen: No such file or directory
[rosrun] Couldn't find executable named rviz below
find: ftsopen: No such file or directory
[#3#zouxidong@23:12:21 ~]$ rosrun turtlesim turtlesim_node
dyld: Library not loaded: librospack.dylib
Referenced from: /Users/baidu/ros_catkin_ws/install_isolated/bin/rospack
Reason: image not found
find: ftsopen: No such file or directory
[rosrun] Couldn't find executable named turtlesim_node below
find: ftsopen: No such file or directory
Asked by westeast on 2017-05-23 10:34:38 UTC
Answers
I solved this problem :
vim /Users/baidu/ros_catkin_ws/install_isolated/bin/rosrun add the following line
DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:/Users/xxx/ros_catkin_ws/install_isolated/lib
Asked by westeast on 2017-05-23 10:56:03 UTC
Comments
On macOS Sierra, due to SIP, DYLD_LIBRARY_PATH has no effect. Then, the way to fix this problem is to add the following options to catkin_make_isolated:
-DCMAKE_MACOSX_RPATH=ON
-DCMAKE_INSTALL_RPATH="[path_to_your_workspace]/install_isolated/lib"
Asked by lubiluk on 2017-07-17 16:41:39 UTC
Comments