What i want to do
I try to use opencv and run a short example program.
Problem
It exits with code -1073741515
. I never managed to use openCV on any of the 4 systems i tried, so i do something wrong but don't know what.
I had diffrenet errors using different attempts (undefined reference, crashing programm without error code, etc.), this here is the just simplest example.
What i figured out
Another post told me, that -1073741515
is equal to 0xC0000135
meaning STATUS_DLL_NOT_FOUND
.
What i tried
The programm crashes, if include #include <opencv2/core/core.hpp>
,
#include <opencv2/highgui/highgui.hpp>
and
#include <opencv2/imgproc/imgproc.hpp>
. When i comment them out, it runs wnd returns 0 as intended. I don't even need to use anything like cv::Mat
or something to make it crash. That seems strange, because the code completion suggests me stuff from openCV, so it somehow sees it. Including #include <opencv2/opencv.hpp>
instead leads to the same error code. Including something beginning with opencv (not opencv2) works, for example #include <opencv/cv.hpp>
, but has not enough functionality.
Source file
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <iostream>
using namespace std;
int main()
{
cv::Mat InputImage = cv::imread("C:/Users/Public/Pictures/Sample Pictures/Chrysanthemum.jpg");
if(!InputImage.empty())
cv::imshow("test", InputImage);
else
cout << "imgage is empty" << endl;
return 0;
}
Project file
TEMPLATE = app
CONFIG += console c++11
CONFIG -= app_bundle
CONFIG -= qt
INCLUDEPATH += D:/opencv/build/include
LIBS += -LD:/opencv/build/x64/vc14/lib
LIBS += -lopencv_world343d
LIBS += -lopencv_world343
SOURCES += \
main.cpp
Relevant folders
Include path:
libs:
project:
build (copied the libs to the release/debug folders too):
Versions
- QT 5.10.1
- MSVC17 64bit Compiler
- Windows 7 Enterprise 64bit
- openCV 3.4.3 (vc14/vc15)