opencv in visual studio 2008

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

opencv in visual studio 2008

mrockth
Hi

I am new to opencv and trying to use Opecv with visual studio 2008. I have followed the instructions: http://opencv.willowgarage.com/wiki/VisualC++_VS2008
and have tried to test a first example:

#include <stdafx.h>
#include<cv.h>
#include<cxcore.h>
#include<highgui.h>

int main( int argc, char** argv )
{
IplImage* img = cvLoadImage( argv[1] );
cvNamedWindow( "Example1", CV_WINDOW_AUTOSIZE );
cvShowImage( "Example1", img );
cvWaitKey(0);
cvReleaseImage( &img );
cvDestroyWindow( "Example1" );
}

it builts ok but when I am trying to run it, I have the following problem:
An unhandheld win 32 exception occured [4692].
How can I resolve this problem?
Thanks

Reply | Threaded
Open this post in threaded view
|

Re: opencv in visual studio 2008

Francisco Ares
Hi

For me it works, are you sure your PATH environment variables point to the
correct OpenCV DLLs ?

Sorry to ask this, but are you giving a full-path image file name in the
command line for the program to run on?

Are you compiling a release or a debug build?  Are the include and
libraries directories correctly configured?

Hope this helps to find out the problem
Francisco


On Sun, Dec 11, 2011 at 5:23 PM, mrockth <[hidden email]> wrote:

> **
>
>
> Hi
>
> I am new to opencv and trying to use Opecv with visual studio 2008. I have
> followed the instructions:
> http://opencv.willowgarage.com/wiki/VisualC++_VS2008
> and have tried to test a first example:
>
> #include <stdafx.h>
> #include<cv.h>
> #include<cxcore.h>
> #include<highgui.h>
>
> int main( int argc, char** argv )
> {
> IplImage* img = cvLoadImage( argv[1] );
> cvNamedWindow( "Example1", CV_WINDOW_AUTOSIZE );
> cvShowImage( "Example1", img );
> cvWaitKey(0);
> cvReleaseImage( &img );
> cvDestroyWindow( "Example1" );
> }
>
> it builts ok but when I am trying to run it, I have the following problem:
> An unhandheld win 32 exception occured [4692].
> How can I resolve this problem?
> Thanks
>
>  
>



--
"If you have an apple and I have an apple and we exchange apples then you
and I will still each have one apple. But if you have an idea and I have
one idea and we exchange these ideas, then each of us will have two ideas."
- George Bernard Shaw