Integrating Opencv With Visual C++ 2008 (Windows XP) : Step-By-Step Installation
Integrating Opencv With Visual C++ 2008 (Windows XP) : Step-By-Step Installation
We need:
2. CMake
3. OpenCV
Step-by-step Installation
2. Install CMake, just use default configuration, including “Do not add CMake to
the system PATH” option.
3. Install OpenCV library for Win32, it’s recommended to use C:\OpenCV2.0, but
choose “Add OpenCV to the system PATH for all users” in install options.
After those 3 have been installed, we need to build OpenCV for Visual C++
2008.
1. Run CMake from Start > All Programs > CMake 2.8 > CMake (cmake-
gui), or from C:\Program Files\CMake 2.8\bin\cmake-gui.exe.
1. Open generated Visual C++ 2008 project from previous step, which is
under C:\OpenCV2.0\VS2008, by launching Visual C++ 2008 and choose
File > Open > Project/Solution, then choose OpenCV.sln. Project
“ALL_BUILD” will be selected.
2. Build all project using Debug configuration. After build process was
finished, you will get ‘Build: 59 succeeded, 0 failed.
3. Build all project now using Release configuration.
4. After both build, you will get 2 folder have been created under
C:\OpenCV2.0\VS2008\bin, i.e. Debug folder and Release folder.
5. Now you may close the IDE. Verify that files cv200d.lib, cvaux200d.lib, etc
are created under C:\OpenCV2.0\VS2008\lib\Debug; also files cv200.lib,
cvaux200.lib, etc are created under C:\OpenCV2.0\VS2008\lib\Release.
7. Open Visual C++ 2008 IDE, then select Tools > Options. In the Options
window, expand Projects and Solutions then select VC++ Directories. Select
Platforms as Win32, add the following path for each Show directories for.
8. You may add new line by pressing New Line (Ctrl-Insert) button then browse (…).
Click OK to close Options windows.
2. Select Project types as Visual C++ > General, then chose Empty Project
template. Specify your project Name and Location.
3. Add new file right click on project name in Solution Explorer > Add > New
Item.
4. Select Categories as Visual C++ > Code, then chose C++ File (.cpp) template.
Specify your file name.
5. Write these sample code.
6. When you try to build the project, you will get the error like these below.
cv200.lib
cvaux200.lib
highgui200.lib
cxcore200.lib
ml200.lib
opencv_ffmpeg200.lib
cxts200.lib
8. Click Apply and OK. Rebuild the project, you should get no error