OpenCV 2.4.13缺少visual studio 2012中的opencv_core2413d.dll

时间:2016-11-21 00:56:41

标签: c++ visual-studio opencv visual-studio-2012

我开始在我的项目中使用opencv,但在2012年设置它时遇到了一些问题。

我下载OpenCV 2.4.13。我经历了很多教程但是我得到了一个错误说

The program can't start because opencv_core2413d.dll is missing from your computer. Try reinstalling the program to fix this problem

以下是我设置的所有步骤:

1)设置Windows环境变量,路径为“C:\ opencv \ build \ x64 \ vc11 \ bin”

2)在vs 2012中打开一个空项目,将配置管理器更改为64位平台。

3)然后在VC ++目录中添加“C:\ opencv \ build \ include”和“C:\ opencv \ build \ include \ opencv” - >包括目录

4)在VC ++目录中添加“C:\ opencv \ build \ x64 \ vc11” - >图书馆目录

5)切换到C / C ++ - >一般 - >其他包含目录,添加“C:\ opencv \ build \ include”

6)将“C:\ opencv \ build \ x64 \ vc11 \ lib”添加到链接器 - >一般 - >其他图书馆馆藏

7)将以下内容添加到链接 - >输入 - >其他依赖

opencv_core2413d.lib
opencv_calib3d2413d.lib
opencv_contrib2413d.lib
opencv_features2d2413d.lib
opencv_highgui2413d.lib
opencv_imgproc2413d.lib

这是我的测试主要使用openCV

#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <iostream>

using namespace cv;
using namespace std;

int main( int argc, char** argv ){ 
    Mat image;
    if( argc != 2){
        cout <<" Usage: display_image ImageToLoadAndDisplay" << endl;
        image = imread("HappyMan's Girl.jpg", CV_LOAD_IMAGE_COLOR);
        // Read the file
    }
    else{
        image = imread(argv[1], CV_LOAD_IMAGE_COLOR);
    }

    if(! image.data ){// Check for invalid input
        cout <<  "Could not open or find the image" << endl ;
        system("pause");
        return -1;
    }

    namedWindow( "HappyMan - Display window", CV_WINDOW_AUTOSIZE );
    // Create a window for display.
    imshow( "HappyMan - Display window", image );
    // Show our image inside it.

    waitKey(0);
    // Wait for a keystroke in the window
    return 0;
}

我可以获得一些帮助吗?

由于

更新了我的系统变量设置图片:

enter image description here

1 个答案:

答案 0 :(得分:0)

只需将dll文件粘贴到项目目录中,其中存在.exe文件,您就可以开始使用了。 另一种方法是将.dll文件粘贴到System32文件夹中(虽然没有试过) 例如C:\ Users \ Reaper \ Documents \ Visual Studio 2013 \ Projects \ ConsoleApplication1 \ Debug 希望这有帮助