Reputation: 69
I'm working with opencv 2.4.0 using eclipse CDT (Indigo Service Release 2) on windows 7 64 bit machine. I complied opencv from sources (using cmake/visual studio express 10) following the steps described on the opencv download site.
Everything worked well when I was using opencv C functions (in my C++ code). When I tried to use cv::Mat, it gave me a linking error (like: undefined reference to `cv::Mat::Mat(_IplImage const*, bool)').
What libraries do I need to link with to make opencv C++ functions work along with pure C ones? I've already linked with opencv_core240 and others that I needed and it worked fine for opencv C functions.
I noticed 2 versions of ocv libraries, one with a suffix 'd', so opencv_core240 and opencv_core240d. What is the difference between the 2?
Upvotes: 0
Views: 647
Reputation: 69
found a solution. when using eclipse with mingw tool chain you should compile opencv with mingw as well. compiling opencv from command line worked for me.
Upvotes: 0
Reputation: 3076
#include <iostream>
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
using namespace cv;
using namespace std;
int main()
{
IplImage *image = cvLoadImage("C:\\any_picture.jpg");
Mat m = Mat(image);
imshow("test",m);
waitKey();
return 0;
}
Upvotes: 1