win7 QT +opencv环境搭建

1、Win7 Qt4.8.5+QtCreator2.8.0+mingw环境参考前博文先搭建

2、下载Cmake2.8.11.2版本,安装。运行

【项目】那编译器选择:MinGW4.4。另外,重新编译OpenCV要使用MinGW4.4编译。 把 “<Qt_directory>\mingw\bin”添加到环境变量PATH中。

在cmd中 gcc -v 看到4.4版本。

3. 编译OpenCV,并测试例子(按照下面例子测试成功)

qt creator2.4.0 + qt4.7.4 + mingw + opencv2.2(win7-32位)配置  http://www.xuebuyuan.com/2162023.html

本实验中2.3.1没有下载成功,所以采用了opencv2.2的版本。

或:OPencv库编译也可参考此文:https://dotuyau.wordpress.com/2014/04/25/opencv_qt_windows/

主要参考下面英文文章:

Steps to build OpenCV 2.3.1 with Qt and MinGW:

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

2. Add “D:\QtSDK\mingw\bin” to the system PATH.

3. Download and install CMake (2.8.5).

4. Download and install OpenCV2.3.1 (OpenCV-2.3.1-win-superpack.exe).

5. Run CMake GUI.

6. Set the source code: “D:\OpenCV2.3.1_src"

7. Set where to build binaries to: “D:\OpenCV2.3.1_out”.

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: “D:\QtSDK\mingw\bin\gcc.exe”

13. For C++ set: “D:\QtSDK\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 "CUDA_TOOLKIT_ROOT_DIR" path.

set CUDA_TOOLKIT_ROOT_DIR to : "D:/QtSDK/Desktop/Qt/4.7.3/mingw/bin"

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

19. Go to "D:\OpenCV2.3.1_out" DIR and type “mingw32-

make” and hit enter (this might take some time).

 

转载于:https://www.cnblogs.com/xihong2014/p/6485294.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值