在Visual"Microsoft Studio 2019"上设置OpenCV 4.1.1的麻烦; ? (非法指示.) [英] trouble with setting up OpenCV 4.1.1 on Visual "Microsoft studio 2019" ? (Illegal Instruction.)

查看:168
本文介绍了在Visual"Microsoft Studio 2019"上设置OpenCV 4.1.1的麻烦; ? (非法指示.)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在Visual Studio上使用Open Cv编写C ++代码.我尝试了很多方法来实现此目标3天.这是我最近几天所做的:

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.下载并解压缩open cv 4.1.1(C:\ opencv).

**1.download and extract open cv 4.1.1 (C:\opencv).

2.下载并安装Visual Microsoft Studio 2019.

2.download and install Visual Microsoft Studio 2019.

3.将open cv的bin目录复制到系统变量路径. (在我的情况下:"C:\ opencv \ build \ x64 \ vc15 \ bin; C:\ opencv \ build")

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文件夹到项目的属性(我的项目名称是opencv): (属性->配置属性->包含目录的值为:(C:\ opencv \ build \ include)

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库目录到(C:\ opencv \ build \ x64 \ vc15 \ lib)

5.edite library directory to ( C:\opencv\build\x64\vc15\lib)

6.然后在链接器菜单->输入->其他依赖项->将其值编辑为"opencv_world411d.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 :

opencv.exe中0x000007FEBA8D3AE2(opencv_world411d.dll)的未处理异常:0xC000001D:非法指令.

gfluidimgproc_func.simd.hpp 您需要找到gfluidimgproc_func.simd.hpp才能查看当前调用堆栈帧的来源

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

另外,我也尝试了Cmake. 首先,配置并生成OpenCV的源文件. 第二,在Microsoft Visual Studio中打开项目并构建所有 然后我建立安装文件夹.一切都成功完成了.

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.

问题: 1.如何解决此错误,以便在Microsoft Visual Studio 2019上运行OpenCV?

questions: 1.how can I fix this error to run OpenCV on Microsoft visual studio 2019 ?

  1. Microsoft Visual Studio 2019是否支持Open CV 4.1.1?你试过了吗? 坦克引起你的注意.
  1. does Microsoft visual studio 2019 support open cv 4.1.1? have you tried it? tanks for your attention.

我的操作系统是:Windows 7 英特尔酷睿i5

my operation system is: windows 7 intel core i5

推荐答案

我遇到了同样的问题,据我了解,这是因为我们使用x64位进行编译并在不支持sse3指令的旧CPU上执行(在我的情况下是旧的i5 750).我相信您唯一的解决方案是在禁用sse3的情况下以32位或64位重新编译OpenCV.

I have the same problem and from what I understand it is because we compile in x64 bit and execute it on an old CPU which doesn't support sse3 instructions (in my case an old i5 750). I believe your only solution is to recompile OpenCV either in 32bit or in 64bit with sse3 disabled.

这篇关于在Visual"Microsoft Studio 2019"上设置OpenCV 4.1.1的麻烦; ? (非法指示.)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆