我已经从github下载了该代码。
每当该代码尝试检查mexopencv(lib文件夹中的文件)时。它显示Matlab 2017a
上的错误是:
[error 3] please make sure gcc >= 4.4 g++ >= 4.4 is installed ...
我有GCC版本的
8.8.0
以下是系统说明
最佳答案
您可能缺少标准库(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/