Finally our final year project is finished. As I've promised in my previous post I'm going to do few posts on OpenCV. In this post I'm going to tell you how to configure MS Visual Studio 2005 to work with OpenCV library.
Step 1: Installiny OpenCV
First you have to download the OpenCV library from Sourceforge and run the installer. It will install OpenCV library on your computer. By default it will be installed to "C:\Program Files\OpenCV". Installer will add "C:\Program Files\OpenCV\bin" to system's PATH variable. But sometimes this do not happen properly. In such cases you'll have to add OpenCV bin directory manually to the system's PATH.
Download OpenCV: http://sourceforge.net/projects/opencvlibrary/
Step 2: Configuring VS 2005
In order to use OpenCv from VS you have to add libraries and header files to projects path. Create Win32 Console Application in VS 2005. Then right click the project form the Solution Explorer and select Properties.
Under "Configuration Properties -> C/C++ -> General" put following folders to "Additional Include Directories".
Then under "Configuration Properties -> Linker -> Input" put following folders to "Additional Dependencies". Add them line by line with double quotes.
Sometimes it is possible that you don't have above lib files in "C:\Program Files\OpenCV\lib" folder. In such situations you just have to compile the OpenCV solution.
It is also possible for you to get complains regarding corex100.dll (it can be corexXXX.dll) when running your OpenCV application. If you get such error build the OpenCV solution and check whether the "C:\Program Files\OpenCV\bin" folder is in your system PATH, if not you either have to add that to the path or copy all the DLLs in bin folder to C:\WINDOWS\SYSTEM32 folder.
So that basically what you have to do to configure VS2005. You can check whether you have configured the VS correctly by compiling and running some sample applications in the "C:\Program Files\OpenCV\samples\c" folder. So have fun with OpenCV.