i write codes like this:
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <iostream>
using namespace std;
using namespace cv;
int main()
{
Mat image = imread("lena.jpg");
if(!image.data)
{
cout << "error" <<endl;
return -1;
}
namedWindow("window");
imshow("window",image);
waitKey(27);
return 0;
}
and in codeblocks 12.11 :
it cannot show the image,and the windows says
XX.exe has stopped working
windows is checking for a solution to the problem...
and in qtcreator 2.4.1
the result is ok.
and i tried cvImageShow both ok
a broblem of codeblocks 12.11?
I fixed this problems.
I changed the gcc version in codeblocks 12.11
I download gcc 4.6.1 to the /Program Files/codeblocks/MinGW
then the opencv program till not working because of missing libgcc_s_dw2-1.dll
google the libgcc_s_dw2-1.dll and put it into /Program Files/codeblocks/MinGW/bin
success!
and maybe this link:OpenCV program cannot run because of missing "libgcc_s_dw2-1.dll" in Code::Block
may help this kind of problem.