Thursday, July 8, 2010

Configuring Visual Studio 2008 with OpenCV2.0

You will find a lot of tutorials on the web telling you how to configure Visual Studio 2008 with OpenCV2.0. One of them was this. I bookmarked it, but still for two days I had been trying different IDEs and a lot of tools... and so many things. But the truth was that I was not able to run a single program on it. At first I thought that it's a bad idea to change from JMF to OpenCV but some how, I got out of these problems.
I got an error that was error PRJ0003 : Error spawning rc.exe
The rc.exe seems to be the resource compiler and it was missing in my visual studio. Some blogs told me to reinstall the Visual studio, Of-course that didn't worked. some even told to reinstall windows, but that was a really bad suggestion. There was One suggestion about installing SDK also. So I did that, and I installed Visual C++ 2008. As the file missing was related to Visual C++ so I thought reinstalling it may solve the problem. And really it was solved.

The next part was telling the linker about the files to be include.
Well the files that they tell over here don't seem to exist for me.
Also I tried these two blogs : http://blog.aguskurniawan.net/post/OpenCV-210-with-Visual-Studio-2010.aspx
and
http://uowteaminvincible.wordpress.com/2010/01/09/getting-started-with-opencv-in-microsoft-visual-studio-2008-in-windows-vista/

and in case of the linker input the files I included were in C:\OpenCV2.0\build\lib\Debug\ eg.
C:\OpenCV2.0\build\lib\Debug\cv200d.lib

Also the program given at one of above resources have to include some header.
The edited program that was running is as below:
------------------------------------------------------------------
#include
#include "stdafx.h"
#include

int main( int argc, char** argv )


{


IplImage* img = cvLoadImage( "c:/temp/monas.jpg",1 );


cvNamedWindow("Monas", CV_WINDOW_AUTOSIZE );


cvShowImage("Monas", img );


cvWaitKey(0);


cvReleaseImage( &img );


cvDestroyWindow("Monas");


}

------------------------------------
So...
Now i am ready to switch to OpenCV.
:)
It Feels Good.

No comments:

Post a Comment