I am using OpenCV 2.4.10 with eclipse C++ with MinGW. This version of opencv only has libraries for visual C so I linked those libraries in MinGW (eclipse). I tried running a simple code for loading and displaying an image:
#include<iostream>
#include<cv.h>
#include<highgui.h>
using namespace std;
using namespace cv;
int main(){
Mat image = imread("D:/photo1.tif",1);
namedWindow( "Display", WINDOW_AUTOSIZE );
imshow( "Display", image );
return 0;
}
But while building it shows following errors:
undefined reference to `cv::imread(std::string const&, int)'
undefined reference to `cv::namedWindow(std::string const&, int)'
undefined reference to `cv::_InputArray::_InputArray(cv::Mat const&)'
undefined reference to `cv::imshow(std::string const&, cv::_InputArray const&)'
I also tried the same with Tesseract OCR engine but there also it was showing the same problem i.e. undefined reference to various functions and classes. I don't know whether I am missing something in linking or building the files. So please help. Thanks