在 Windows 上安装 OpenCV 并使用 Visual Studio C++ 构建程序
Posted
技术标签:
【中文标题】在 Windows 上安装 OpenCV 并使用 Visual Studio C++ 构建程序【英文标题】:Installing OpenCV on windows and building programs with Visual Studio C++ 【发布时间】:2013-11-09 18:48:07 【问题描述】:我学习了很多关于在 Windows 上安装 OpenCV 的教程,包括:
Installing OpenCV 2.4.3 in Visual C++ 2010 Express
How to build applications with OpenCV inside the Microsoft Visual Studio
但应用程序没有构建。它说找不到库。
【问题讨论】:
【参考方案1】:添加新属性表时,您必须在编译应用程序时提供要链接到项目的库列表。
重要的是要注意每个版本的 OpenCV 的库名称 CHANGE。即调试附加依赖项是(这在说明中并不明显):
版本 2.4.6 附加依赖项(调试):
opencv_calib3d246d.lib opencv_contrib246d.lib opencv_core246d.lib opencv_features2d246d.lib opencv_flann246d.lib opencv_gpu246d.lib opencv_haartraining_engined.lib opencv_highgui246d.lib opencv_imgproc246d.lib opencv_legacy246d.lib opencv_ml246d.lib opencv_nonfree246d.lib opencv_objdetect246d.lib opencv_ocl246d.lib opencv_photo246d.lib opencv_stitching246d.lib opencv_superres246d.lib opencv_ts246d.lib opencv_video246d.lib opencv_videostab246d.lib
2.4.3 附加依赖项(调试):
opencv_core243d.lib opencv_imgproc243d.lib opencv_highgui243d.lib opencv_ml243d.lib opencv_video243d.lib opencv_features2d243d.lib opencv_calib3d243d.lib
2.4.6 附加依赖项(发布):
opencv_calib3d246.lib opencv_contrib246.lib opencv_core246.lib opencv_features2d246.lib opencv_flann246.lib opencv_gpu246.lib opencv_haartraining_engine.lib opencv_highgui246.lib opencv_imgproc246.lib opencv_legacy246.lib opencv_ml246.lib opencv_nonfree246.lib opencv_objdetect246.lib opencv_ocl246.lib opencv_photo246d.lib opencv_stitching246.lib opencv_superres246.lib opencv_ts246.lib opencv_video246.lib opencv_videostab246.lib
2.4.3 附加依赖项(发布):
opencv_core243.lib opencv_imgproc243.lib opencv_highgui243.lib opencv_ml243.lib opencv_video243.lib opencv_features2d243.lib opencv_calib3d243.lib
【讨论】:
以上是关于在 Windows 上安装 OpenCV 并使用 Visual Studio C++ 构建程序的主要内容,如果未能解决你的问题,请参考以下文章
在 windows(W32) 上安装 opencv 以与代码块一起使用
在 Windows 上使用 Eclipse 安装 OpenCV 3.0.0
如何在 Windows 7 上使用 Visual Studio 2012(64 位)安装 OpenCV?
C++:如何在 Windows 10 上使用编译器 MinGW 9.2.0 安装 OpenCV