缺少opencv_core248d.dll [英] Missing opencv_core248d.dll

查看:470
本文介绍了缺少opencv_core248d.dll的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试安装OpenCV 2.4.8.事实证明,这要复杂得多.这些教程都已过时.这是我当前的问题:

I'm trying to install OpenCV 2.4.8. Turns out this is far more complicated as expected. The tutorials are all outdated. Here is my current problem:

我正在64位计算机上运行,​​并且正在尝试一个简单的示例代码:

I'm running on a 64 bit machine, and am trying just a simple sample code:

#include <opencv\cv.h>
#include <opencv\highgui.h>

using namespace cv;


int main() {
    Mat image;

    VideoCapture cap;
    cap.open(0);

    namedWindow("window",1);

    while(true) {

        cap >> image;

        imshow("window", image);

        waitKey(33);
    }


    return 0;
}

运行此命令时,出现错误,指出缺少opencv_core248d.dll.检查bin目录,它在那里.我该如何解决?

When I run this, I get an error stating that opencv_core248d.dll is missing. Checking the bin directory, it's there. How do I fix this?

致谢

在过去3个小时中,我一直在处理此问题.谁能帮助我解决这个问题,就会得到我的很多声望和爱..​​.严重的我感到绝望

I've been on this issue for the past 3 hours. Whoever can help me solve this issue will get so much rep and love from me...seriously I'm getting desperate

Edit2:一些设置的图片:

Picture of some settings:

OPENCV_BUILD = C:\ OpenCV \ build \

OPENCV_BUILD = C:\OpenCV\build\

推荐答案

您是否尝试过将C:\OpenCV2.0\bin添加到PATH变量中?是的,安装OpenCV可能很麻烦:/

Have you tried adding C:\OpenCV2.0\bin to your PATH variables? Yup, installing OpenCV can be a chore :/

您是否已经完成了正确的项目设置,例如添加了源库,源目录等?无论如何,如果我的猜测正确的话,以下将解决该特定错误:

Have you done the proper project setup, like adding source library, source directories etc? Anyway, if my guess if right, the following will resolve that particular error:

转到项目属性,链接器->输入->其他依赖项,在其中添加opencv_core248d.dll并进行编译.如果出现新错误,则表示您尚未进行正确的配置.

Go to your project properties, Linker -> Input -> Additional Dependencies, add opencv_core248d.dll in and compile. If a new error appears, means you have yet to do the proper configurations.

评论

在这里,包含目录和库目录.您是否添加了相关的build/include& \lib分别进入include和library目录?这是一些需要完成的配置".

Here, the include directories and library directories. Did you add the relevant build/include & \lib into to the include and library directory respectively? This are some of the "configuration" that need to be done.

回答您的修改

是的,看起来您已经完成了配置.被您的评论弄糊涂了.

Yup, looks like you did do the configurations. Was confused by your comments.

1)我不确定$(OPENCV_BUILD)是否可以工作.也许您想尝试使用C:\OpenCV2.4\lib,(直接链接)等代替它.

1) I am not really sure if $(OPENCV_BUILD) will work. Maybe you would like to try C:\OpenCV2.4\lib, (link directly) etc instead of that.

2)转到链接器输入,并编辑与此相关的其他依赖项(来自我拥有的一本书中的图像):

2)Go to your linker input and edit the additional dependencies to this (image from one of the books I have):

希望它能奏效.不用担心我知道你的感受.我被困在安装OpenCV上将近一个星期,而只有一个人的youtube视频救了我.我需要编辑一些头文件.但这是与您不同的问题.祝你好运,希望我的方法行得通.

Hope it works. And don't worry. I know how you feel. I was stuck at installing OpenCV for almost a week, and only one guy's youtube video saved me. I needed to edit some header files. But it's a different problem from yours. Good luck and hope my method work.

希望这可以解决您的问题,请尝试这些.

Hopefully this solve your problem, try these.

1)如果您使用的是创可贴"方法,则意味着每次都必须复制粘贴dll文件,我怀疑您的PATH变量有误.只需仔细检查即可.

1) If you are using the "band-aid" method, which means having to copy paste the dll files every time, my suspicion would be that your PATH variables is wrong. Just double check it.

相当于您的

类似于(从中复制dll文件的路径/在属性页内添加的库目录的路径.但是,使用bin文件夹代替了最后的lib) :

the equivalent for yours would be something like(the path of where you copied the dll files from/the path of the library directories you added inside the property page. But instead of lib at the end, you use the bin folder):

C:\OpenCV2.3\build\x86\vc10\bin

关于此的更多详细信息:

More details on this : Setting window path

如果已执行此操作,只需检查是否已用分号隔开即可.

If you have done this, just check that you have separated them with a semi-colon.

2)不知道这是否真的是丢失.dll文件的解决方案,如果我没有记错的话,更多的是用于链接错误.但是,如果第1步不起作用,或者第1步不起作用,而您又遇到另一个错误,请尝试一下.最多只能撤消它.

2) Not sure if this is really the solution for missing .dll file, if I remember correctly, it's more for linking errors. But give it a shot if step 1 doesn't work, or if step one works and you face another error. At the most, you can just undo it.

对于每个头文件(例如core.hpp文件),添加以下行:

For each header files, for instance the core.hpp file, add the following lines:

#pragma comment(lib,"opencv_core248.lib")
#pragma comment(lib,"opencv_core248d.lib")

需要对您使用的所有头文件执行此操作.在哪里放置?我把我的放在这里:

This need to be done for all the header files you use. Where to place it? I place mine here:

highgui.hpp等的用法与此相同,但是您更改了名称,因此#pragma comment(lib,"opencv_core248.lib")变为了#pragma comment(lib,"opencv_highgui248.lib"等...

This goes the same for highgui.hpp, etc, but you change the name, so #pragma comment(lib,"opencv_core248.lib") becomes #pragma comment(lib,"opencv_highgui248.lib", etc...

希望一切顺利.我认为,如果path变量有效,但是如果第二种方法不起作用,那么我将不再有任何线索.

Hope all goes well. I think if the path variable, but if not and 2nd method doesn't work, I have no clues anymore.

这篇关于缺少opencv_core248d.dll的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆