Linking opencv with ROS using cmake issue
Am getting this compilation error
../devel/lib/libXY.so: undefined reference to `cv::calcOpticalFlowPyrLK
In my CMake
find_package(OpenCV REQUIRED core imgproc highgui videoio PATHS /home/polar/soft/lib/opencv/opencv-3.1.0/cmake)
... then
target_link_libraries(${file2link}
${catkin_LIBRARIES}
${MY_LIB}
${MY_LIB}
${gsl_LIBRARIES}
# ${Boost_PROGRAM_OPTIONS_LIBRARY} ${Boost_REGEX_LIBRARY}
${Boost_LIBRARIES}
${OpenCV_LIB}
${OpenCV_LIBRARIES}
${OpenCV_LIBS}
)
For info, I installled opencv 3.1.0 myself. In XY.h I just call opencv like
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/opencv.hpp>
#include "opencv2/video/tracking.hpp"
#include "opencv2/imgproc/imgproc.hpp"
#include "opencv2/imgproc/imgproc_c.h"
#include <opencv2/features2d.hpp>
#include "opencv2/xfeatures2d.hpp"
Any idea on the source of the problem?