只需要在项目工程文件pro中添加上:
INCLUDEPATH += G:/opencv/build/include
G:/opencv/build/include/opencv
G:/opencv/build/include/opencv2
LIBS+= G:opencvuildx86vc12libopencv_ts300.lib
G:opencvuildx86vc12libopencv_ts300d.lib
G:opencvuildx86vc12libopencv_world300.lib
G:opencvuildx86vc12libopencv_world300d.lib
修改为自己的opencv路径即可。