0
Good Morning I am studying the Opencv library for computer vision on Ubuntu 14.04 I am using Eclipse Mars.2 programming in c++. The following error appears:
./image. o: indefinite reference to symbol '_Zn2cv6imreaderkns_6stringei'
My code is below
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <iostream>
using namespace cv;
using namespace std;
int main( int argc, char** argv )
{
if( argc != 2)
{
cout <<" Usage: display_image Tom.jpg" << endl;
return -1;
}
Mat image;
image = imread(argv[1], CV_LOAD_IMAGE_COLOR); // Read the file
if(! image.data ) // Check for invalid input
{
cout << "Could not open or find the image" << std::endl ;
return -1;
}
namedWindow( "Display window", WINDOW_AUTOSIZE );// Create a window for display.
imshow( "Display window", image ); // Show our image inside it.
waitKey(0); // Wait for a keystroke in the window
return 0;
}
I’ve tried everything but got nothing. I have no idea what’s going on. Thank you for getting answers
You are using Opencv 2.4.? Or Opencv 3.?
– Berriel
This is a linkediting error, right? Assuming yes, you have checked that your Makefile is including the Opencv libraries correctly?
– Luiz Vieira
Hello friend, I’m using version 3.1.0. Thank you so much for your help. It really was an inclusion issue for opencv libraries. In this specific case it was opencv_imgcodecs. I’m having trouble figuring out which one I should reference in each case, but I’m studying on. If you have a good manual to indicate me I will be grateful. Thank you very much for the tip.
– Adiel