opencv pkg-config configuration problem in ubuntu with fuerte
After ros-fuerte installation in ubuntu 12.04, I am having problems to compile my opencv programs.
I am getting the following results:
/usr/bin/ld: cannot find -lopencv_nonfree /usr/bin/ld: cannot find -lopencv_photo /usr/bin/ld: cannot find -lopencv_stitching /usr/bin/ld: cannot find -lopencv_ts /usr/bin/ld: cannot find -lopencv_videostab
I realised that ros-fuerte packages for ubuntu changes default pkg-config configuration file for opencv library, pointing to the files in the ros installation.
# pkg-config --cflags opencv -I/opt/ros/fuerte/include/opencv -I/opt/ros/fuerte/include # pkg-config --libs opencv -L/opt/ros/fuerte/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
- Why is ros changing the default opencv configuration for compilation?
- Can't just use a different pkg-config configuration file such as ros-opencv.pc?
- And, in case the default configuration must be changed, why it is not compatible with previous opencv configurations?
Update
I have found the problem. The setup.sh script of ros-fuerte updates the variable that uses pkg-config to find the configuration files
PKG_CONFIG_PATH=/opt/ros/fuerte/lib/pkgconfig:$PKG_CONFIG_PATH export PKG_CONFIG_PATH
Now pkg-config gives preference to ROS configuration.
So the answer now is: Is this really needed to be in the setup.sh script?
Maybe rosmake can set this variable when using pkg-config to configure the compilation.
Have you installed
ros-feurte-vision-opencv
usingapt-get
?Yes. I installed all ros fuerte using apt-get system.