ld: cannot find -lsensor_msgs (ROS fuerte on ubuntu12.04)
hi,
I have not idea what have happened, but trying to solve another problem (out of the scope of this question, but related to that cvOpticalFlowPyrLK could not be found on cv::) suddenly, when compiling i find this problem :
Linking CXX executable bin/Optical_Flow
/usr/bin/cmake -E cmake_link_script CMakeFiles/Optical_Flow.dir/link.txt --verbose=1
/usr/bin/c++ -O2 -g -Wl,-rpath,/opt/ros/fuerte/stacks/vision_opencv/cv_bridge/lib -Wl,-rpath,/opt/ros/fuerte/stacks/image_common/image_transport/lib -Wl,-rpath,/opt/ros/fuerte/stacks/pluginlib/lib -Wl,-rpath,/opt/ros/fuerte/stacks/image_common/camera_info_manager/lib -Wl,-rpath,/opt/ros/fuerte/stacks/image_common/camera_calibration_parsers/lib -Wl,-rpath,/opt/ros/fuerte/stacks/geometry/tf/lib -Wl,-rpath,/opt/ros/fuerte/stacks/bullet/lib -pthread CMakeFiles/Optical_Flow.dir/src/Optical_Flow.o -o bin/Optical_Flow -rdynamic -L/opt/ros/fuerte/lib -L/opt/ros/fuerte/stacks/vision_opencv/cv_bridge/lib -L/opt/ros/fuerte/stacks/image_common/image_transport/lib -L/opt/ros/fuerte/stacks/pluginlib/lib -L/opt/ros/fuerte/stacks/image_common/camera_info_manager/lib -L/opt/ros/fuerte/stacks/image_common/camera_calibration_parsers/lib -L/opt/ros/fuerte/stacks/geometry/tf/lib -L/opt/ros/fuerte/stacks/bullet/lib -lopencv_calib3d -lopencv_contrib -lopencv_core -lopencv_features2d -lopencv_flann -lopencv_gpu -lopencv_highgui -lopencv_imgproc -lopencv_legacy -lopencv_ml -lopencv_nonfree -lopencv_objdetect -lopencv_photo -lopencv_stitching -lopencv_ts -lopencv_video -lopencv_videostab -lcv_bridge -lsensor_msgs -limage_transport -lpoco_lite -lboost_fs_wrapper -ltinyxml -lroslib -lmessage_filters -lroscpp -lrostime -lrosconsole -lroscpp_serialization -lxmlrpcpp -lcamera_info_manager -lcamera_calibration_parsers -ltf -lboost_thread-mt -lBulletDynamics -lBulletCollision -lLinearMath -Wl,-rpath,/opt/ros/fuerte/lib:/opt/ros/fuerte/stacks/vision_opencv/cv_bridge/lib:/opt/ros/fuerte/stacks/image_common/image_transport/lib:/opt/ros/fuerte/stacks/pluginlib/lib:/opt/ros/fuerte/stacks/image_common/camera_info_manager/lib:/opt/ros/fuerte/stacks/image_common/camera_calibration_parsers/lib:/opt/ros/fuerte/stacks/geometry/tf/lib:/opt/ros/fuerte/stacks/bullet/lib
/usr/bin/ld: cannot find -lsensor_msgs
make[2]: Leaving directory `/home/dlr/ros_workspace/OpticalFlow'
collect2: ld returned 1 exit status
make[1]: Leaving directory `/home/dlr/ros_workspace/OpticalFlow'
make[2]: *** [bin/Optical_Flow] Error 1
make[1]: *** [CMakeFiles/Optical_Flow.dir/all] Error 2
make: *** [all] Error 2
I have no idea what could have happened, since it was compiling before with the exact same code. The only thing that comes to my mind it could have bee, is that I reinstalled the repos packages ros-fuerte-* . Still, my previously installed ROS is also the repos one, and I was using it almost out of the box.
In .bashrc I have:
source /opt/ros/fuerte/setup.bash
source /home/dlr/ros_workspace/setup.bash
export ROS_PACKAGE_PATH=~/ros_workspace:/opt/ros/fuerte/stacks:/opt/ros/fuerte/share:/opt/ros/fuerte/share/ros
export ROS_WORKSPACE=~/ros_workspace
export EDITOR='gedit'
in my manifest I have :
<depend package="sensor_msgs"/>
But in /opt/ros/fuerte/lib:
$ ls *sensor*
ls: cannot access *sensor*: No such file or directory
Can somebody give me hints how to track this problem?? Thank you
Just a comment on your .bashrc: it looks like you set up an overlay in ~/ros_workspace using rosinstall or rosws. If that is true, it might be better to remove the two export lines and manage the ROS_PACKAGE_PATH completely using rosws. Maybe you'll have to add OpticalFlow using rosws though.