程序无法启动,因为缺少 opencv_core2410d.dll
Posted
技术标签:
【中文标题】程序无法启动,因为缺少 opencv_core2410d.dll【英文标题】:The program can't start because opencv_core2410d.dll is missing 【发布时间】:2015-03-07 08:55:00 【问题描述】:我安装了 visual studio 2012。我有 windows 8.1。然后我在 c 分区中提取 opencv 2.4.10。
创建了可视化 C++ 项目->win32 控制台应用程序。
因为我有 x64 机器
build menu->Configuration manager->platform->x64
然后我在我的 vs 项目中设置以下配置。
project->properties->configuration->all configuration
VC++Directories->Library Directories->
C:\opencv\build\x64\vc11\bin,C:\opencv\build\x64\vc11\lib
C/C++->Genaral->Additional Include Derectories->
C:\opencv\build\include,C:\opencv\build\include\opencv2,C:\opencv\build\include\opencv
改变
Configuration->Debug
Select Linker->Input->Additional Dependencies
opencv_core2410d.lib
opencv_highgui2410d.lib
opencv_imgproc2410d.lib
opencv_calib3d2410d.lib
opencv_contrib2410d.lib
opencv_features2d2410d.lib
opencv_flann2410d.lib
opencv_gpu2410d.lib
opencv_legacy2410d.lib
opencv_ml2410d.lib
opencv_nonfree2410d.lib
opencv_objdetect2410d.lib
opencv_photo2410d.lib
opencv_stitching2410d.lib
opencv_superres2410d.lib
opencv_ts2410d.lib
opencv_video2410d.lib
然后
change Configuration->Release
select Linker->Input->Additional Dependencies
opencv_core2410.lib
opencv_highgui2410.lib
opencv_imgproc2410.lib
opencv_calib3d2410.lib
opencv_contrib2410.lib
opencv_features2d2410.lib
opencv_flann2410.lib
opencv_gpu2410.lib
opencv_legacy2410.lib
opencv_ml2410.lib
opencv_nonfree2410.lib
opencv_objdetect2410.lib
opencv_photo2410.lib
opencv_stitching2410.lib
opencv_superres2410.lib
opencv_ts2410.lib
opencv_video2410.lib
opencv_videostab2410.lib
然后我创建了一个类并编写了代码
#include "stdafx.h"
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/core/core.hpp"
int main()
//declare a new iplimage pointer
IplImage*myimage;
//load image
myimage = cvLoadImage("D:\\visual studio 2012\\katussa.jpg",1);
cvNamedWindow("Smile",1);
cvShowImage("Smile",myimage);
//wait for the key to close the window
cvWaitKey(0);
cvDestroyWindow("Smile");
cvReleaseImage(&myimage);
return 0;
当我运行时,我收到了错误消息 。
【问题讨论】:
【参考方案1】:您需要将 OpenCV 添加到您的系统路径:
您需要将目录 C:\opencv\build\x86\vc10\bin 添加到系统 PATH 中。此目录包含运行代码所需的 OpenCV DLL。
打开控制面板→系统→高级系统设置→高级选项卡→环境变量...
在系统变量部分,选择路径 (1)、编辑 (2),然后键入 C:\opencv\build\x86\vc10\bin; (3),然后点击确定。
忍者编辑:
确保您已遵循所有this tutorial上的步骤
【讨论】:
在我的情况下,我必须将“C:\opencv\build\x64\vc11\bin”添加到系统路径并且它有效。thanx @GPPK【参考方案2】:即使您已将相关的 bin 文件(例如 \opencv-x.x.x\build\install\x64\vc15\bin
)添加到系统路径环境变量中,有时您也可能会收到此错误。
在我的情况下,一旦我重新启动我的电脑,它就可以工作。或者,在重新启动系统之前,只需重新启动 Visual Studio 并查看它是否正常工作。
【讨论】:
以上是关于程序无法启动,因为缺少 opencv_core2410d.dll的主要内容,如果未能解决你的问题,请参考以下文章
程序无法启动,因为缺少 libgcc_s_dw2-1.dll
程序无法启动,因为它缺少带有 C++ 应用程序的 MSVCP110.dll