博客http://blog.csdn.net/qiurisuixiang/article/details/8665278已经完整地介绍了整个环境配置。需要一步不差按原执行。需要说明的是,几个path的设定,千万不能有错,否者接下来的程序编译将会出错。path增加:
D:QtQt5.4.25.4mingw491_32in;#你的qt安装目录
D:opencvin;#你的opencv安装目录
D:CMakein;#你的cmake目录
D:QtQt5.4.2Toolsmingw491_32in #你的qt目录,是否和D:QtQt5.4.25.4mingw491_32in重复?没关系,不影响你的程序便编译。
opencv的库设置,不同的版本做不同的选择,这里是opencv2.49:
INCLUDEPATH +=D:opencvincludeopencv
D:opencvincludeopencv2
D:opencvinclude
LIBS +=
d:opencvliblibopencv_calib3d249d.dll.a
d:opencvliblibopencv_contrib249d.dll.a
d:opencvliblibopencv_core249d.dll.a
d:opencvliblibopencv_features2d249d.dll.a
d:opencvliblibopencv_flann249d.dll.a
d:opencvliblibopencv_gpu249d.dll.a
d:opencvliblibopencv_highgui249d.dll.a
d:opencvliblibopencv_imgproc249d.dll.a
d:opencvliblibopencv_legacy249d.dll.a
d:opencvliblibopencv_ml249d.dll.a
d:opencvliblibopencv_objdetect249d.dll.a
d:opencvliblibopencv_video249d.dll.a