I am trying to use Open Cv on Visual studio to write c++ code. I tried a lot of ways to reach this goal for 3 days. here is what I did in these days:
**1.download and extract open cv 4.1.1 (C:\opencv).
2.download and install Visual Microsoft Studio 2019.
3.copy the bin directory of open cv to the system variable path. (in my case:"C:\opencv\build\x64\vc15\bin;C:\opencv\build" )
4.add include folder to the project's properties(my project name is opencv): (properties->configuration properties ->edite include directories value to : (C:\opencv\build\include )
5.edite library directory to ( C:\opencv\build\x64\vc15\lib)
6.then in linker menu->inpute->adittional dependancies -> edit its value to "opencv_world411d.lib" .**
now I write a simple code to test open cv:
#include <iostream>
#include <opencv2/highgui/highgui.hpp>
using namespace std;
using namespace cv;
int main() {
Mat im = imread("cameraman.tiff", 0);
}
this code built correctly but when I run it It doesn't work with error :
Unhandled exception at 0x000007FEBA8D3AE2 (opencv_world411d.dll) in opencv.exe: 0xC000001D: Illegal Instruction.
gfluidimgproc_func.simd.hpp not found You need to find gfluidimgproc_func.simd.hpp to view the source for the current call stack frame
"I added screenshot" error report
also, I tried Cmake too. first, configure and generate OpenCV's source file. second, open the project in Microsoft visual studio and build all then I build the install folder.all has been done successfully.
questions: 1.how can I fix this error to run OpenCV on Microsoft visual studio 2019 ?
- does Microsoft visual studio 2019 support open cv 4.1.1? have you tried it? tanks for your attention.
my operation system is: windows 7 intel core i5