Ask Your Question
0

opencv.exe application error

asked 2015-09-10 09:08:18 -0600

updated 2015-09-11 02:30:28 -0600

pklab gravatar image

Hello , I am very new to opencv i trying to create a project in VS2010 using opencv library.I installed and configure the VS2010 with opencv according to the below website http://opencv-srf.blogspot.in/2013/05... I took one example from net and tried to compile

#include "opencv2/core/core.hpp"
#include "opencv2/highgui/highgui.hpp"
#include "iostream"
using namespace cv;
using namespace std;

int main( int argc, char** argv )
{
    if( argc != 2)
    {
     std::cout <<" Usage: display_image ImageToLoadAndDisplay" << endl;
     return -1;
    }

    Mat image;
    image = imread(argv[1], IMREAD_COLOR); // Read the file

    if(! image.data ) // Check for invalid input
    {
        cout << "Could not open or find the image" << std::endl ;
        return -1;
    }

    namedWindow( "Display window", WINDOW_AUTOSIZE ); // Create a window for display.
    imshow( "Display window", image ); // Show our image inside it.

    waitKey(0); // Wait for a keystroke in the window
    return 0;
}

The above program is compiled perfectly but when running i am getting an error "The application was unable to start correctly (0xc000007b).Click OK to close the application"(OPENCV.exe-Application Error) I am using windows 7 64bit ,VS2010 and using \opencv\build\x86\vc11\lib for the current project. Please can anyone let me know why i am facing the problem.

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
1

answered 2015-09-11 02:56:33 -0600

pklab gravatar image

updated 2015-09-11 03:15:26 -0600

Some hints:

  1. Official Quick Start is a better starting point.
  2. vc11 libs are for Visual Studio 2012. You should use vc10 binaries if you have.
  3. If you don't have need to debug the opencv code, the debug version of the libs are worthless... avoid it and use opencv_*XYZ.lib instead of opencv_*XYZd.lib.
  4. Ship the DLLs with your executable taking care to use same version as is for the .lib files you are linking to: opencv_*XYZ.lib => opencv_*XYZ.dll , opencv_*XYZd.lib => opencv_*XYZd.dll. (not all of Opencv DLLs are needed, it depends from your code. In your example opencv_coreXYZ.dll and opencv_highguiXYZ.dll should be enough)
  5. You have to use same platform for application and libs. If you are building a 32bit application you have use 32bit version of the Opencv libs/dll...

I hope this helps

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2015-09-10 09:08:18 -0600

Seen: 346 times

Last updated: Sep 11 '15