vs下配置opencv
vs下面配置opencv一共有4个地方需要修改
release版本:
1.VC++ Directories→include Directories,添加
D:\opencv\opencv\build\include D:\opencv\opencv\build\include\opencv2;
2.VC++ Directories→Library Directories,添加
D:\opencv\opencv\build\x64\vc14\lib
3.Linker→General→Additional Library Directories:opencv_world412.lib
4.Linker→Input→Additional Dependencies:opencv_world412.lib
有时候需要添加对应dll到exe执行目录(release模式相比Debug模式少个d)
Debug版本:
1.2步骤同上
3和4步骤中,将opencv_world412.lib换成opencv_world412d.lib
记录:我的opencv4.1.2还无法使用cuda,于是我又编译了opencv4.4.0,但只编译了release版本,debug版本报错了,所以暂时还是先用opencv412把,需要用到cuda时尽量用release版本
上图中,opencv文件夹是412版本,opencv-4.4.0文件夹是440版本
需要的文件在D:\opencv-4.4.0\build\install中,重新配置的话,上面所说的路径应分别改为:
D:\opencv-4.4.0\build\install\include
D:\opencv-4.4.0\build\install\include\opencv2
D:\opencv-4.4.0\build\install\x64\vc14\lib