On Windows 7 64 bit, AMD processor, I installed OpenCV 2.4.5, with eclipse CDT Juno and MinGW, everything to the latest update. Previously eclipse CDT and MinGW compiled 100+ source files without problems. They even compile this small OpenCV source file,
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/opencv.hpp>
#include <iostream>
using namespace std;
int main()
{
IplImage* img1 = cvLoadImage("lenna.png");
cvShowImage("MyWindow1", img1);
cv::Mat img2;
img2 = cv::imread("lenna.png", CV_LOAD_IMAGE_COLOR);
cv::namedWindow("MyWindow2", CV_WINDOW_AUTOSIZE);
cv::imshow("MyWindow2", img2);
cvWaitKey(0);
return 0;
}
but when I try to Run it then it breaks with notorious
"The application was unable to start correctly (0xc0000005). Click OK
to close the application."
What might be wrong and what would be solution to this problem?
- OpenCV (PreCompiled) is unzipped to "C:\OpenCV245PC\ (README,index.rst and CMakeLists.txt are there with all subfolders)
- Windows System PATH is set to C:\OpenCV245PC\build\x86\mingw\bin
- Eclipse GCC C++ Compiler, Include paths (-I) is set to "C:\OpenCV245PC\build\include"
- Eclipse MinGW C++ Linker, Library search path (-L) is set to: "C:\OpenCV245PC\build\x86\mingw\lib"
- Eclipse MinGW C++ Linker, Libraries (-l) are set to:
opencv_calib3d245 opencv_contrib245 opencv_core245
opencv_features2d245 opencv_flann245 opencv_gpu245 opencv_highgui245
opencv_imgproc245 opencv_legacy245 opencv_ml245 opencv_nonfree245
opencv_objdetect245 opencv_photo245 opencv_stitching245
opencv_video245 opencv_videostab245
Best Answer
After many trials and errors I decided to follow this tutorial and to compile my own binaries as it seems that too many people are complaining that precompiled binaries are NOT working for them. Eclipse CDT Juno was already installed.
My procedure was as follows:
You can use this code to test your setup:
Don't forget to put image to the C:/ (or wherever you might find suitable, just be sure that eclipse have read acess.