Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

OpenCV SURF is there but can't be found

I was able to run OpenCV with ROS. I have run basic things (like loading images, getting video stream ect) but I am trying to run SURF or SIFT and I get this error:

Linking CXX executable /home/jim/ROS/catkin_ws/devel/lib/opencv_ros/open
CMakeFiles/open.dir/src/open.cpp.o: In function `main':
open.cpp:(.text+0x15b): undefined reference to `cv::SURF::SURF(double, int, int, bool, bool)'
CMakeFiles/open.dir/src/open.cpp.o: In function `cv::SURF::~SURF()':
open.cpp:(.text._ZN2cv4SURFD1Ev[_ZN2cv4SURFD1Ev]+0xe): undefined reference to `vtable for cv::SURF'
open.cpp:(.text._ZN2cv4SURFD1Ev[_ZN2cv4SURFD1Ev]+0x26): undefined reference to `vtable for cv::SURF'
open.cpp:(.text._ZN2cv4SURFD1Ev[_ZN2cv4SURFD1Ev]+0x2e): undefined reference to `vtable for cv::SURF'
open.cpp:(.text._ZN2cv4SURFD1Ev[_ZN2cv4SURFD1Ev]+0x3b): undefined reference to `VTT for cv::SURF'
collect2: error: ld returned 1 exit status
make[2]: *** [/home/jim/ROS/catkin_ws/devel/lib/opencv_ros/open] Error 1
make[1]: *** [opencv_ros/CMakeFiles/open.dir/all] Error 2
make: *** [all] Error 2
Invoking "make" failed

The project name is "opencv_ros" and the code is in "open.cpp". I have include these headers:

#include <stdio.h>
#include <iostream>
#include "opencv2/core/core.hpp"
#include "opencv2/features2d/features2d.hpp"
#include "opencv2/nonfree/features2d.hpp"
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/nonfree/nonfree.hpp"

the thing is that when I run the same code in my c++ IDE (code::blocks) it runs just fine. I even found the header file and saw that it's in the correct place (according to the include I gave).

I am running ubuntu 14.04 64bit on Indigo with OpenCV 2.4.9 .

Why cant it find SURF in ROS?