I am trying to read an image in OpenCV, like this:
#include <opencv2/core/core.hpp>
#include <opencv2/imgcodecs.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/opencv.hpp>
using namespace cv;
using namespace std;
int main (int argv, char **argc)
{
Mat image = imread("Foam_Image.jg", CV_LOAD_IMAGE_GRAYSCALE);
return 0;
}
But I get the following error:
undefined reference to cv::imread(cv::String const&, int)
It seems that OpenCV cannot find the libraries I included, maybe because I didn't link them correctly, or maybe there are some libraries missing. Does anyone know how to look for missing libraries or how to link the libraries in OpenCV?