下面给出的具体的用Qt Creator和MinGW编译OpenCV的步骤:
Steps to build OpenCV with Qt Creator and MinGW
1. Run CMake GUI.
2. Set the source code: “<OpenCV_directory>”
3. Set where to build binaries to: “<build_directory>”. Example: E:\OpenCV-2.3.1\MinGW
4. Press Configure
5. Let CMake create the new folder.
6. Specify the generator: MinGW Makefiles.
7. Select “Specify Native Compilers” and click Next.
8. For C set: “<Qt_directory>/mingw/bin/gcc.exe”
9. For C++ set: “<Qt_directory>/mingw/bin/g++.exe”
10. Click Finish
11. In the configuration screen type in “DEBUG” (or “RELEASE” if you want to build a release version) for CMAKE_BUILD_TYPE. Check BUILD_EXAMPLES if you want. Check WITH_QT .Uncheck WITH_QT.
12. Click configure again.
13. The configure screen will make you specify the qmake path. It is in the Qt directory
Steps to build OpenCV with Qt Creator and MinGW
1. Run CMake GUI.
2. Set the source code: “<OpenCV_directory>”
3. Set where to build binaries to: “<build_directory>”. Example: E:\OpenCV-2.3.1\MinGW
4. Press Configure
5. Let CMake create the new folder.
6. Specify the generator: MinGW Makefiles.
7. Select “Specify Native Compilers” and click Next.
8. For C set: “<Qt_directory>/mingw/bin/gcc.exe”
9. For C++ set: “<Qt_directory>/mingw/bin/g++.exe”
10. Click Finish
11. In the configuration screen type in “DEBUG” (or “RELEASE” if you want to build a release version) for CMAKE_BUILD_TYPE. Check BUILD_EXAMPLES if you want. Check WITH_QT .Uncheck WITH_QT.
12. Click configure again.
13. The configure screen will make you specify the qmake path. It is in the Qt directory