OpenCV的3.4.0 - zlibd1.dll没有被发现

问题描述 投票:0回答:2

我有以下的方案,这是一样的this tutorial page for OpenCV 3.4.0。我在64位的笔记本电脑与Windows 10企业64位使用Visual Studio 2017年社区。

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

using namespace cv;
using namespace std;

int main( int argc, char** argv )
{
    if( argc != 2)
    {
     cout <<" Usage: display_image ImageToLoadAndDisplay" << endl;
     return -1;
    }

    Mat image;
    image = imread(argv[1], IMREAD_COLOR); // Read the file

    if( image.empty() ) // Check for invalid input
    {
        cout << "Could not open or find the image" << std::endl ;
        return -1;
    }

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

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

随着包括和链接器的目录和库设置了这个项目,该解决方案基于就好了。但是,当我运行程序时,我得到以下错误:

“代码执行无法继续,因为zlibd1.dll未找到。重新安装该程序可能会解决这个问题。”

从我最初的研究,它不一定是从Visual Studio 2017来当我试图创建一个新的项目,我没有选择的选择“Win32控制台应用程序。”此源代码坐落在该项目类型的Windows控制台应用程序在Visual C ++,支持.NET框架4.5。

我缺少的是在这里吗?

基于本教程中,我应该只使用库和动态链接库的OpenCV 3.4.0提供。我在一个点记得使用的NuGet尝试安装OpenCV 3.4.0再次,as explained here,当我试图从OpenCV的3.4.0本身中的文件解决编译器错误有关的fopen。

c++ opencv dll visual-studio-2017
2个回答
0
投票

好了,显然这是对我的系统路径的问题。它没有设置正确,之前,我曾是设置为以下路径变量:

%OPENCV_DIR%\lib
%OPENCV_DIR%\bin

与$(OPENCV_DIR)是刚刚的OpenCV 3.4.0 build目录。

但目录存在不存在,因此库找不到。所以,我取而代之的是这样的:

%OPENCV_DIR%\x64\vc15\bin
%OPENCV_DIR%\x64\vc15\lib

该程序现在运行。我在想回到那里?

无论哪种方式,重要的教训要注意:当你得到一个弹出消息说,因为图书馆缺少程序无法打开,并且是OpenCV的3.4.0的一部分,要确保在Windows 10系统高级设置你的系统路径存在的OpenCV的目录。


0
投票

这个包有下调试运行,并导致zlibd1.dll问题一个问题。切换到释放,如果你可以,或者使用不同的NuGet包。

**enter image description here**

enter image description here

© www.soinside.com 2019 - 2024. All rights reserved.