I've finally managed to get opencv 2.3.1 to work with eclipse, mingw and 32 bit XP. I'll put up a howto when everzthing works, as I couldn't find one for this toolchain.
The trouble is that any attempt to show the results in a window causes an unhandled exception. The images save fine, and I was able to run an Sobel kernel on them so everything else seems fine. It seems to crash when namedWindow is called.
I'm including libopencv_core231, libopencv_highgui231, libopencv_imgproc231 and libopencv_legacy231 with the linker.
Here is the code:
#include <cv.h>
#include <highgui.h>
#include <iostream>
using namespace cv;
int main(int argc, char **argv)
{
std::cout<<"Hello"<<std::endl;
//Create image
Mat lena, lenasobel;
//Load lena image
lena = imread("C:\\lena.jpeg");
if(lena.data)
std::cout<<"File has "<<lena.cols<<" rows and "<<lena.rows<<" columns. "<<lena.channels()<<" channels."<<std::endl;
if(!lena.data)
std::cout<<"File Not Read."<<std::endl;
lenasobel=lena.clone();
Sobel(lena,lenasobel,lenasobel.depth(),1,1,3);
std::vector<int> jpg_type;
jpg_type.push_back(100);
jpg_type.push_back(CV_IMWRITE_JPEG_QUALITY);
imwrite("C:\\lenaout.jpeg",lenasobel,jpg_type);
//Save works!
namedWindow( "lena" , CV_WINDOW_AUTOSIZE);
imshow( "lena" ,lena);
return 0;
}
Does anyone have any ideas? I'm not sure what to do next!