OpenCV linker errors in ROS Fuerte
I am trying to compile and test our packages from tu-darmstadt-ros-pkg with the upcoming ROS Fuerte from the official package repositories with Ubuntu Oneiric (amd64). Whenever a package is built which depends indirectly from OpenCV, I got strange linker errors about undefined references for OpenCV functions.
In this case I am trying to compile the object_tracker package, which depends from image_geometry, which uses OpenCV. This is the output from make VERBOSE=1:
Linking CXX executable ../../bin/object_tracker
cd /opt/hector/external/tu-darmstadt-ros-pkg/hector_worldmodel/object_tracker/build/src && /usr/bin/cmake -E cmake_link_script CMakeFiles/object_tracker.dir/link.txt --verbose=1
/usr/lib/ccache/c++ -m64 -O2 -g -Wl,-rpath,/opt/ros/fuerte/stacks/geometry/tf/lib -I/opt/ros/fuerte/stacks/geometry/tf/msg_gen/cpp/include -I/opt/ros/fuerte/stacks/geometry/tf/srv_gen/cpp/include -Wl,-rpath,/opt/ros/fuerte/stacks/bullet/lib -Wl,-rpath,/opt/ros/fuerte/stacks/geometry/tf_conversions/lib -Wl,-rpath,/opt/ros/fuerte/stacks/orocos_kinematics_dynamics/orocos_kdl/install_dir/lib /opt/ros/fuerte/lib/libopencv_calib3d.so /opt/ros/fuerte/lib/libopencv_contrib.so /opt/ros/fuerte/lib/libopencv_core.so /opt/ros/fuerte/lib/libopencv_features2d.so /opt/ros/fuerte/lib/libopencv_flann.so /opt/ros/fuerte/lib/libopencv_gpu.so /opt/ros/fuerte/lib/libopencv_highgui.so /opt/ros/fuerte/lib/libopencv_imgproc.so /opt/ros/fuerte/lib/libopencv_legacy.so /opt/ros/fuerte/lib/libopencv_ml.so /opt/ros/fuerte/lib/libopencv_objdetect.so /opt/ros/fuerte/lib/libopencv_stitching.so /opt/ros/fuerte/lib/libopencv_ts.so /opt/ros/fuerte/lib/libopencv_video.so -Wl,-rpath,/opt/ros/fuerte/stacks/vision_opencv/image_geometry/lib /opt/ros/fuerte/lib/libopencv_calib3d.so /opt/ros/fuerte/lib/libopencv_contrib.so /opt/ros/fuerte/lib/libopencv_core.so /opt/ros/fuerte/lib/libopencv_features2d.so /opt/ros/fuerte/lib/libopencv_flann.so /opt/ros/fuerte/lib/libopencv_gpu.so /opt/ros/fuerte/lib/libopencv_highgui.so /opt/ros/fuerte/lib/libopencv_imgproc.so /opt/ros/fuerte/lib/libopencv_legacy.so /opt/ros/fuerte/lib/libopencv_ml.so /opt/ros/fuerte/lib/libopencv_objdetect.so /opt/ros/fuerte/lib/libopencv_stitching.so /opt/ros/fuerte/lib/libopencv_ts.so /opt/ros/fuerte/lib/libopencv_video.so -I/opt/hector/external/tu-darmstadt-ros-pkg/hector_worldmodel/worldmodel_msgs/msg_gen/cpp/include -I/opt/hector/external/tu-darmstadt-ros-pkg/hector_worldmodel/worldmodel_msgs/srv_gen/cpp/include -I/opt/hector/external/tu-darmstadt-ros-pkg/hector_slam/hector_nav_msgs/srv_gen/cpp/include -pthread CMakeFiles/object_tracker.dir/object_tracker.o CMakeFiles/object_tracker.dir/Object.o CMakeFiles/object_tracker.dir/ObjectModel.o -o ../../bin/object_tracker -rdynamic -L/opt/ros/fuerte/lib -L/opt/ros/fuerte/stacks/geometry/tf/lib -L/opt/ros/fuerte/stacks/bullet/lib -L/opt/ros/fuerte/stacks/geometry/tf_conversions/lib -L/opt/ros/fuerte/stacks/orocos_kinematics_dynamics/orocos_kdl/install_dir/lib -L/opt/ros/fuerte/stacks/vision_opencv/image_geometry/lib -ltf -lboost_thread-mt -lBulletDynamics -lBulletCollision -lLinearMath -lsensor_msgs -lmessage_filters -lroscpp -lrostime -lrosconsole -lroscpp_serialization -lxmlrpcpp -ltf_conversions -lorocos-kdl -limage_geometry -Wl,-rpath,/opt/ros/fuerte/lib:/opt/ros/fuerte/stacks/geometry/tf/lib:/opt/ros/fuerte/stacks/bullet/lib:/opt/ros/fuerte/stacks/geometry/tf_conversions/lib:/opt/ros/fuerte/stacks/orocos_kinematics_dynamics/orocos_kdl/install_dir/lib:/opt/ros/fuerte/stacks/vision_opencv/image_geometry/lib
/usr/bin/ld: CMakeFiles/object_tracker.dir/object_tracker.o: undefined reference to ...