Use the opencv library in QT creator (compiled successfully in Windows 7)
Compile opencv2.0
1. download and install the tdm-mingw-1.908.0-4.4.1-2. After installation, add the bin to the system path.
2. Install opencv2.0 for Windows
3. Install cmake
4. Open cmake, configure the source code and target path, and select mingw makefiles to generate the target makefile.
5. Go to the set target path and make until all libraries are generated.
Configure QT creator
Developed by QTProgramGenerally, you need to use qmake to generate the MAKEFILE file. Since qmake cannot identify spaces when parsing paths, it is necessary to ensure that the installation path of opencv cannot contain spaces (c: \ Program Files \ opencv is not acceptable ).
Add the following statement to the project when creating the project file (hello. Pro, Suffix: Pro:
Includepath + = D: \ QT \ OpenCV-2.0.0 \ include \ opencv
Libs + = D: \ QT \ OpenCV-2.0.0 \ Lib \ libcv200.dll. \
D: \ QT \ OpenCV-2.0.0 \ Lib \ libcxcore200.dll. \
D: \ QT \ OpenCV-2.0.0 \ Lib \ libml200.dll. \
D: \ QT \ OpenCV-2.0.0 \ Lib \ libcvaux200.dll. \
D: \ QT \ OpenCV-2.0.0 \ Lib \ libhighgui200.dll.
In this way, opencv 2.0 can be used in QT.