I have an opencv project and all worked well so far until I just tried to rebuild my code today: I got the following error:
undefined reference to `cv::KalmanFilter::KalmanFilter(int, int, int, int)'
undefined reference to `cv::imshow(cv::String const&, cv::_InputArray const&)'
undefined reference to `cv::waitKey(int)'
I am not sure why this error occurs, I could only assume that it might be somehow connected with the fact that I ran sudo apt-get autoremove
or sudo apt-get upgrade
. The only other thing I did before was installing arduino.
I am not sure why I get this error as I was always able to compile until today.
Can it be that the opencv include for the kalman filter has changed? Here is a snipped of my includes:
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/core/core.hpp>
#include <opencv2/video/video.hpp> //for kalman filter
//Include headers for OpenCV GUI handling
#include <opencv2/highgui/highgui.hpp>
In my CMakeLists.txt:
add_compile_options(-std=c++11)
find_package(catkin REQUIRED COMPONENTS
cv_bridge
)
include_directories(
${OpenCV_INCLUDE_DIRS}
${OpenCV_LIB_COMPONENTS}
${OpenCV_LIBRARIES}
I have opencv 3.3.1 running.