gpt4 book ai didi

c++ - 程序无法启动,因为缺少opencv_core2410d.dll

转载 作者:可可西里 更新时间:2023-11-01 18:27:12 24 4
gpt4 key购买 nike

我安装了 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;
}

当我运行时,我收到了错误消息程序无法启动,因为缺少opencv_core2410d.dll

最佳答案

您需要将 OpenCV 添加到您的系统路径:

您需要将目录 C:\opencv\build\x86\vc10\bin 添加到您的系统 PATH 中。此目录包含运行代码所需的 OpenCV DLL。

打开控制面板→系统→高级系统设置→高级选项卡→环境变量...

在系统变量部分,选择路径 (1)、编辑 (2),然后键入 C:\opencv\build\x86\vc10\bin; (3),然后点击确定。

忍者编辑:

确保您已按照所有 this tutorial 上的步骤进行操作

关于c++ - 程序无法启动,因为缺少opencv_core2410d.dll,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28913116/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com