ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Thanks for Ur help. I've tried the first approach, and it looks like it finds properly the new OpenCV installation. But, there's something more here. Without ROS opencv it compiles without problem: -- OpenCV Root directory is /usr/local/share/OpenCV -- OpenCV include directories are /usr/local/include/opencv -- OpenCV libs directory is: /usr/local/lib/libopencv_core.so.3.0.0;/usr/local/lib/libopencv_imgproc.so.3.0.0;/usr/local/lib/libopencv_highgui.so.3.0.0;/usr/local/lib/libopencv_ml.so.3.0.0;/usr/local/lib/libopencv_video.so.3.0.0;/usr/local/lib/libopencv_features2d.so.3.0.0;/usr/local/lib/libopencv_calib3d.so.3.0.0;/usr/local/lib/libopencv_objdetect.so.3.0.0;/usr/local/lib/libopencv_contrib.so.3.0.0;/usr/local/lib/libopencv_legacy.so.3.0.0;/usr/local/lib/libopencv_flann.so.3.0.0

When ROS opencv is installed, it fails to compile: foo.cpp:(.text+0x661): undefined reference to `cv::_OutputArray::_OutputArray(cv::Mat&)' But the includes and libraries variables are the same!!

Thanks for Ur help. help bchr. I've tried the first approach, and it looks like it finds properly the new OpenCV installation. But, there's something more here. Without ROS opencv it compiles without problem: problem:

-- OpenCV Root directory is /usr/local/share/OpenCV
-- OpenCV include directories are /usr/local/include/opencv
-- OpenCV libs directory is: /usr/local/lib/libopencv_core.so.3.0.0;/usr/local/lib/libopencv_imgproc.so.3.0.0;/usr/local/lib/libopencv_highgui.so.3.0.0;/usr/local/lib/libopencv_ml.so.3.0.0;/usr/local/lib/libopencv_video.so.3.0.0;/usr/local/lib/libopencv_features2d.so.3.0.0;/usr/local/lib/libopencv_calib3d.so.3.0.0;/usr/local/lib/libopencv_objdetect.so.3.0.0;/usr/local/lib/libopencv_contrib.so.3.0.0;/usr/local/lib/libopencv_legacy.so.3.0.0;/usr/local/lib/libopencv_flann.so.3.0.0

/usr/local/lib/libopencv_core.so.3.0.0;/usr/local/lib/libopencv_imgproc.so.3.0.0;/usr/local/lib/libopencv_highgui.so.3.0.0;/usr/local/lib/libopencv_ml.so.3.0.0;/usr/local/lib/libopencv_video.so.3.0.0;/usr/local/lib/libopencv_features2d.so.3.0.0;/usr/local/lib/libopencv_calib3d.so.3.0.0;/usr/local/lib/libopencv_objdetect.so.3.0.0;/usr/local/lib/libopencv_contrib.so.3.0.0;/usr/local/lib/libopencv_legacy.so.3.0.0;/usr/local/lib/libopencv_flann.so.3.0.0

When ROS opencv is installed, it fails to compile: compile:

foo.cpp:(.text+0x661): undefined reference to `cv::_OutputArray::_OutputArray(cv::Mat&)'

But the includes and libraries variables are the same!!

Thanks for Ur help bchr. I've tried the first approach, and it looks like it finds properly the new OpenCV installation. But, there's something more here. Without ROS opencv it compiles without problem:

-- OpenCV Root directory is /usr/local/share/OpenCV
-- OpenCV include directories are /usr/local/include/opencv
-- OpenCV libs directory is: /usr/local/lib/libopencv_core.so.3.0.0;/usr/local/lib/libopencv_imgproc.so.3.0.0;/usr/local/lib/libopencv_highgui.so.3.0.0;/usr/local/lib/libopencv_ml.so.3.0.0;/usr/local/lib/libopencv_video.so.3.0.0;/usr/local/lib/libopencv_features2d.so.3.0.0;/usr/local/lib/libopencv_calib3d.so.3.0.0;/usr/local/lib/libopencv_objdetect.so.3.0.0;/usr/local/lib/libopencv_contrib.so.3.0.0;/usr/local/lib/libopencv_legacy.so.3.0.0;/usr/local/lib/libopencv_flann.so.3.0.0

When ROS opencv is installed, it fails to compile:

foo.cpp:(.text+0x661): undefined reference to `cv::_OutputArray::_OutputArray(cv::Mat&)'

But the includes and libraries variables are the same!!

-- OpenCV Root directory is /usr/local/share/OpenCV
-- OpenCV include directories are /usr/local/include/opencv
-- OpenCV libs directory is /usr/local/lib/libopencv_core.so.3.0.0;/usr/local/lib/libopencv_imgproc.so.3.0.0;/usr/local/lib/libopencv_highgui.so.3.0.0;/usr/local/lib/libopencv_ml.so.3.0.0;/usr/local/lib/libopencv_video.so.3.0.0;/usr/local/lib/libopencv_features2d.so.3.0.0;/usr/local/lib/libopencv_calib3d.so.3.0.0;/usr/local/lib/libopencv_objdetect.so.3.0.0;/usr/local/lib/libopencv_contrib.so.3.0.0;/usr/local/lib/libopencv_legacy.so.3.0.0;/usr/local/lib/libopencv_flann.so.3.0.0

Thanks to both for Ur help bchr. your help. I've tried the bchr first approach, and it looks like it finds properly the new OpenCV installation. But, there's something more here. Without ROS opencv it compiles without problem:

-- OpenCV Root directory is /usr/local/share/OpenCV
-- OpenCV include directories are /usr/local/include/opencv
-- OpenCV libs directory is: /usr/local/lib/libopencv_core.so.3.0.0;/usr/local/lib/libopencv_imgproc.so.3.0.0;/usr/local/lib/libopencv_highgui.so.3.0.0;/usr/local/lib/libopencv_ml.so.3.0.0;/usr/local/lib/libopencv_video.so.3.0.0;/usr/local/lib/libopencv_features2d.so.3.0.0;/usr/local/lib/libopencv_calib3d.so.3.0.0;/usr/local/lib/libopencv_objdetect.so.3.0.0;/usr/local/lib/libopencv_contrib.so.3.0.0;/usr/local/lib/libopencv_legacy.so.3.0.0;/usr/local/lib/libopencv_flann.so.3.0.0

When ROS opencv is installed, it fails to compile:

foo.cpp:(.text+0x661): undefined reference to `cv::_OutputArray::_OutputArray(cv::Mat&)'

But the includes and libraries variables are the same!!

-- OpenCV Root directory is /usr/local/share/OpenCV
-- OpenCV include directories are /usr/local/include/opencv
-- OpenCV libs directory is /usr/local/lib/libopencv_core.so.3.0.0;/usr/local/lib/libopencv_imgproc.so.3.0.0;/usr/local/lib/libopencv_highgui.so.3.0.0;/usr/local/lib/libopencv_ml.so.3.0.0;/usr/local/lib/libopencv_video.so.3.0.0;/usr/local/lib/libopencv_features2d.so.3.0.0;/usr/local/lib/libopencv_calib3d.so.3.0.0;/usr/local/lib/libopencv_objdetect.so.3.0.0;/usr/local/lib/libopencv_contrib.so.3.0.0;/usr/local/lib/libopencv_legacy.so.3.0.0;/usr/local/lib/libopencv_flann.so.3.0.0

Thanks to both for your help. I've tried the bchr first approach, and it looks like it finds properly the new OpenCV installation. But, there's something more here. Without ROS opencv it compiles without problem:

-- OpenCV Root directory is /usr/local/share/OpenCV
-- OpenCV include directories are /usr/local/include/opencv
-- OpenCV libs directory is: /usr/local/lib/libopencv_core.so.3.0.0;/usr/local/lib/libopencv_imgproc.so.3.0.0;/usr/local/lib/libopencv_highgui.so.3.0.0;/usr/local/lib/libopencv_ml.so.3.0.0;/usr/local/lib/libopencv_video.so.3.0.0;/usr/local/lib/libopencv_features2d.so.3.0.0;/usr/local/lib/libopencv_calib3d.so.3.0.0;/usr/local/lib/libopencv_objdetect.so.3.0.0;/usr/local/lib/libopencv_contrib.so.3.0.0;/usr/local/lib/libopencv_legacy.so.3.0.0;/usr/local/lib/libopencv_flann.so.3.0.0

When ROS opencv is installed, it fails to compile:

foo.cpp:(.text+0x661): undefined reference to `cv::_OutputArray::_OutputArray(cv::Mat&)'

But the includes and libraries variables are the same!!

-- OpenCV Root directory is /usr/local/share/OpenCV
-- OpenCV include directories are /usr/local/include/opencv
-- OpenCV libs directory is /usr/local/lib/libopencv_core.so.3.0.0;/usr/local/lib/libopencv_imgproc.so.3.0.0;/usr/local/lib/libopencv_highgui.so.3.0.0;/usr/local/lib/libopencv_ml.so.3.0.0;/usr/local/lib/libopencv_video.so.3.0.0;/usr/local/lib/libopencv_features2d.so.3.0.0;/usr/local/lib/libopencv_calib3d.so.3.0.0;/usr/local/lib/libopencv_objdetect.so.3.0.0;/usr/local/lib/libopencv_contrib.so.3.0.0;/usr/local/lib/libopencv_legacy.so.3.0.0;/usr/local/lib/libopencv_flann.so.3.0.0

EDITED:

Ok! Ive done some good progress. The problem is that ROS sets the CPATH environment variable as:

echo $CPATH 
/usr/local/include:/home/jep/catkin_ws/devel/include:/opt/ros/groovy/include

So, even if you include the correct headers gcc wil always find the old ones if you don't delete the CPATH variable... I've tried adding /usr/local/include to CPATH, but the same behaviour appears, it only seems to work unsetting CPATH... Any ideas? I would like to keep CPATH as it is to avoid breaking anythin when I need to use ROS!

Thanks to both for your help. I've tried the bchr first approach, and it looks like it finds properly the new OpenCV installation. But, there's something more here. Without ROS opencv it compiles without problem:

-- OpenCV Root directory is /usr/local/share/OpenCV
-- OpenCV include directories are /usr/local/include/opencv
-- OpenCV libs directory is: /usr/local/lib/libopencv_core.so.3.0.0;/usr/local/lib/libopencv_imgproc.so.3.0.0;/usr/local/lib/libopencv_highgui.so.3.0.0;/usr/local/lib/libopencv_ml.so.3.0.0;/usr/local/lib/libopencv_video.so.3.0.0;/usr/local/lib/libopencv_features2d.so.3.0.0;/usr/local/lib/libopencv_calib3d.so.3.0.0;/usr/local/lib/libopencv_objdetect.so.3.0.0;/usr/local/lib/libopencv_contrib.so.3.0.0;/usr/local/lib/libopencv_legacy.so.3.0.0;/usr/local/lib/libopencv_flann.so.3.0.0

When ROS opencv is installed, it fails to compile:

foo.cpp:(.text+0x661): undefined reference to `cv::_OutputArray::_OutputArray(cv::Mat&)'

But the includes and libraries variables are the same!!

-- OpenCV Root directory is /usr/local/share/OpenCV
-- OpenCV include directories are /usr/local/include/opencv
-- OpenCV libs directory is /usr/local/lib/libopencv_core.so.3.0.0;/usr/local/lib/libopencv_imgproc.so.3.0.0;/usr/local/lib/libopencv_highgui.so.3.0.0;/usr/local/lib/libopencv_ml.so.3.0.0;/usr/local/lib/libopencv_video.so.3.0.0;/usr/local/lib/libopencv_features2d.so.3.0.0;/usr/local/lib/libopencv_calib3d.so.3.0.0;/usr/local/lib/libopencv_objdetect.so.3.0.0;/usr/local/lib/libopencv_contrib.so.3.0.0;/usr/local/lib/libopencv_legacy.so.3.0.0;/usr/local/lib/libopencv_flann.so.3.0.0

EDITED:

Ok! Ive done some good progress. The problem is that ROS sets the CPATH environment variable as:

echo $CPATH 
/usr/local/include:/home/jep/catkin_ws/devel/include:/opt/ros/groovy/include

So, even if you include the correct headers gcc wil always find the old ones if you don't delete the CPATH variable... I've tried adding /usr/local/include to CPATH, but the same behaviour appears, it only seems to work unsetting CPATH... Any ideas? I would like to keep CPATH as it is to avoid breaking anythin when I need to use ROS!