在Qt Creator与MinGW中配置OpenCV 2.2

本文详细介绍了如何在QtCreator2.0.1和MinGW环境下,通过一系列步骤成功构建OpenCV2.2的过程。包括安装QtSDK、设置系统环境、下载并安装CMake和OpenCV,以及使用CMakeGUI进行配置和构建。

Steps to build OpenCV 2.2 with Qt Creator 2.0.1 and MinGW:

1. Install Qt SDK with the C++ compiler option (MinGW). You can download ithere.

2. Add “C:<Qt_directory>/mingw/bin” to the system PATH.

3. Download and install CMake (2.8).

4. Download and install OpenCV2.2.

5. Run CMake GUI.

6. Set the source code: “C:\<OpenCV_directory>”

7. Set where to build binaries to: “C:\<build_directory>”. Example: “C:\OpenCV2.2MinGW”

8. Press Configure

9. Let CMake create the new folder.

10. Specify the generator: MinGW Makefiles.

11. Select “Specify Native Compilers” and click Next.

12. For C set: “C:\<Qt_directory>\mingw\bin\gcc.exe”

13. For C++ set: “C:\<Qt_directory>\mingw\bin\g++.exe”

14. Click Finish

15. 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.

16. Click configure again.

17. The configure screen will make you specify the qmake path. It is in the Qt directory: “C:\<Qt_directory>\qt\bin\qmake.exe”

18. Click configure again. Click generate. Close CMake.

19. Go to the command prompt and go to the folder where you built your binaries (command: cd C:\<build_directory>) and type “mingw32-make” and hit enter (this might take some time).

20. Then type “mingw32-make install” and hit enter again.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值