quot;The program can#39;t start because opencv_world300.dll is missing from your computerquot; error in C++(“程序无法启动,因为您的计算机缺少 opencv_world300.dllC++ 中的错误)
问题描述
我想在 Visual Studio 2013 中编译一个 opencv Console C++ 程序.这是我的代码:
I want to compile an opencv Console C++ program in Visual Studio 2013. This is my code:
#include "stdafx.h"
#include "opencv2/highgui/highgui.hpp"
#include <iostream>
using namespace cv;
using namespace std;
int main(int argc, const char** argv)
{
Mat img = imread("rgb_1.png", CV_LOAD_IMAGE_UNCHANGED); //read the image data in the file "MyPic.JPG" and store it in 'img'
if (img.empty()) //check whether the image is loaded or not
{
cout << "Error : Image cannot be loaded..!!" << endl;
//system("pause"); //wait for a key press
return -1;
}
namedWindow("MyWindow", CV_WINDOW_AUTOSIZE); //create a window with the name "MyWindow"
imshow("MyWindow", img); //display the image which is stored in the 'img' in the "MyWindow" window
waitKey(0); //wait infinite time for a keypress
destroyWindow("MyWindow"); //destroy the window with the name, "MyWindow"
return 0;
}
虽然我已经在 Computer 和 Visual Studio 目录中的属性中定义了所有目录,但我收到以下错误:
Although I have defined all the directories in properties both in Computer and Visual Studio directories, I get the following error:
程序无法启动,因为您的计算机缺少 opencv_world300.dll."
"The program can't start because opencv_world300.dll is missing from your computer."
我该如何解决这个问题?
How can I fix this problem?
推荐答案
windows 下可以复制:
Under windows you can copy it from:
<your install directory>opencv30uildx64vc12in
并将其放入您的 Visual Studio 解决方案中(我假设您使用的是 x64/Release 配置):
And put it in your Visual Studio solution (I assume you are using a x64/Release configuration):
<your solution directory>x64Release
或者你可以将上面的 OpenCV 添加到你的 PATH 环境变量中
Or you you can add the above OpenCV to your PATH environment variable
这篇关于“程序无法启动,因为您的计算机缺少 opencv_world300.dll"C++ 中的错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:“程序无法启动,因为您的计算机缺少 opencv_world300.dll"C++ 中的错误
- 一起使用 MPI 和 OpenCV 时出现分段错误 2022-01-01
- 静态初始化顺序失败 2022-01-01
- 近似搜索的工作原理 2021-01-01
- C++ 协变模板 2021-01-01
- 使用/clr 时出现 LNK2022 错误 2022-01-01
- Stroustrup 的 Simple_window.h 2022-01-01
- 如何对自定义类的向量使用std::find()? 2022-11-07
- STL 中有 dereference_iterator 吗? 2022-01-01
- 与 int by int 相比,为什么执行 float by float 矩阵乘法更快? 2021-01-01
- 从python回调到c++的选项 2022-11-16