matlab - 为什么在Matlab中发生有关gcc的错误?

标签 matlab opencv visual-studio-2012 mex

我已经从github下载了该代码。
每当该代码尝试检查mexopencv(lib文件夹中的文件)时。它显示Matlab 2017a上的错误是:

[error 3] please make sure gcc >= 4.4 g++ >= 4.4 is installed ...

我有GCC版本的8.8.0
以下是系统说明
  • 窗口10
  • Visual Studio 2012
  • Matlab 2017a
  • opencv 2.4.10
  • mexopencv(从您的文件夹LIB安装)
  • 最佳答案

    您可能缺少标准库(Windows中为.dll,而Linux中为.lib)。该代码是在Linux下开发的(仅针对Linux系统也提供了帮助),并在Windows 7下进行了测试。

    The method was tested under OS linux lubuntu 14.04, CPU intel i5 and 16GB of RAM. This guide was written under a linux-based distribution scope, more precisely debian. Unfortunately we lack experience to address bugs or any problem that could emerge in non-linux OS, we will provide only linux OS help regarding execution problems, we apologise. we tested this code on Windows7. We successfully installed opencv 2.4.10 following this tutorial: [http://www.learnopencv.com/install-opencv3-on-windows/]



    这表明mex函数也是基于linux的。如果您自己在系统上编译源代码,则错误应消失,例如使用MinGW(也称为GCC),请参见here

    编辑:
    README.markdown文件(在LIB / mexopencv-master.zip下)为UNIX(包括ubuntu 14.04)和Windows系统的openCV和mexopencv函数的安装过程提供了一些指导。后者指出:

    Browse to mexopencv root folder, and type the following in the MATLAB command window:

    >> mexopencv.make
    

    By default, mexopencv assumes the OpenCV library is installed in C:\opencv. If this is not the case, specify the path as an argument:

    >> mexopencv.make('opencv_path', 'c:\your\path\to\opencv')
    

    Note that if you build OpenCV from source, this path specification might not work out of the box. You need to replace dll files in the OpenCV package with newly built binaries. Or, you need to modify +mexopencv/make.m to correctly link your MEX-files with the library.

    To remove existing mexopencv binaries, use the following command.

    >> mexopencv.make('clean', true)
    


    它需要Matlab支持的标准C++编译器(see here),任何Visual Studio安装都可以,因为建议使用开源选项MinGW。只要记住选择正确的系统(通常是64位)即可。

    关于matlab - 为什么在Matlab中发生有关gcc的错误?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59478820/

    相关文章:

    matlab - 如何在 MATLAB 中获取所有打开图形的句柄

    matlab - 如何在 Matlab 中减小直方图上条形的宽度

    opencv - 矩阵的 cvInvert() 返回 0 矩阵?但在 Matlab 中返回实际值

    c# - 当我将图像提供给经过训练的模型时,它为未在模型中训练的对象提供了 80% 以上的准确度

    c# - 在 C# 中生成代码块

    matlab - sgolay函数在Matlab R2013a中如何工作?

    java - 如何在 Matlab 中运行 java .jar

    python - 我为什么会收到此错误:imutils VideoStream(src = 0)返回VIDIOC_QBUF:树莓派中的无效参数

    asp.net-mvc-3 - ASP.NET MVC 3 无法识别 .cshtml View 文件

    visual-studio-2012 - Visual Studio 的与语言无关的项目类型?