我有一个非常简单的程序来测试我的opencv安装:
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include "opencv/cv.h"
int main() {
// read an image
cv::Mat image= cv::imread("c:\\img.jpg");
// create image window named "My Image"
cv::namedWindow("My Image");
// show the image on window
cv::imshow("My Image", image);
// wait key for 5000 ms
cv::waitKey(0);
return 1;
}
我正在使用Qt Creator,当我运行代码时它退出时出现错误:-1073741515,根据这篇文章:http://www.qtcentre.org/threads/57083-1073741515-problem与未找到的dll有关。
这真令人讨厌,因为我确信我已经按照这本书做了很多事情。这是我的专业档案:
#-------------------------------------------------
#
# Project created by QtCreator 2015-03-30T06:33:21
#
#-------------------------------------------------
QT += core
QT -= gui
TARGET = opencv_pls
CONFIG += console
CONFIG -= app_bundle
TEMPLATE = app
SOURCES += main.cpp
INCLUDEPATH += D:\\opencv_bin\\install\\include
LIBS += -LD:\\opencv_bin\\lib \
-lopencv_core2410.dll \
-lopencv_highgui2410.dll \
-lopencv_imgproc2410.dll \
-lopencv_features2d2410.dll \
-lopencv_calib3d2410.dll
这是我的PATH
:
C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\Program Files (x86)\Common Files\Microsoft Shared\Windows Live;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files (x86)\AMD APP\bin\x86_64;C:\Program Files (x86)\AMD APP\bin\x86;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files (x86)\Windows Live\Shared;C:\Program Files (x86)\Skype\Phone\;C:\Program Files (x86)\CMake\bin;D:\Qt\4.7.0\bin;D:\mingw\bin;D:\OpenCV-2.2.0_bin\bin;D:\OpenCV-2.2.0_bin\include;D:\Program Files\MATLAB\bin;C:\Program Files (x86)\MiKTeX 2.9\miktex\bin\;d:\Program Files\MATLAB\MATLAB Compiler Runtime\v80\runtime\win64;d:\Program Files (x86)\MATLAB\MATLAB Compiler Runtime\v81\runtime\win32;
一切似乎都井然有序。
Dependency Walker显示以下错误:
但根据这篇文章:Win 7, 64 bit, dll problems这些都是误报。
我错过了什么?我几乎处于拔头发的阶段。 请帮忙