如何安装MinGW-w64 C/C ++编译器以在MATLAB 2016b中使用? [英] How to install MinGW-w64 C/C++ compiler for use in MATLAB 2016b?

查看:1178
本文介绍了如何安装MinGW-w64 C/C ++编译器以在MATLAB 2016b中使用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在安装要在MATLAB 20176b中使用的MinGW-w64 C/C ++编译器,但有一些错误.如何使用所有必要的调整来安装此编译器,以在Matlab 2016b中使用?

I am installing the MinGW-w64 C/C++ compiler for use in MATLAB 20176b but there is several errors for that. How can install this compiler with all the necessary adjustments to use in Matlab 2016b?

直接从Matlab获得的第一种方法:

As the first way directly from Matlab:

  1. 从此处下载了适用于Windows的MinGW-w64 C/C ++编译器: https://www. mathworks.com/matlabcentral/fileexchange/52848-matlab-support-for-mingw-w64-c-c++-compiler

  1. Downloaded the MinGW-w64 C/C++ compiler for Windows from here: https://www.mathworks.com/matlabcentral/fileexchange/52848-matlab-support-for-mingw-w64-c-c++-compiler

运行真实的Matlab并获得安装和安装软件包的批准后,它会显示错误消息:

After running true Matlab and approval for installation and installing the packages, it gives an error as:

安装第三方软件时出现问题.解决 此问题,请联系技术支持

There was a problem installing the third-party software. To resolve this issue, contact Technical Support

第二种方法是分别安装MinGW-w64 C/C ++编译器,然后进行调整以在Matlab中使用.但是在安装后,Matlab无法识别它.

The second approach is to install the MinGW-w64 C/C++ compiler separately and then adjust to use in Matlab. But After installation Matlab doesn't recognize it.

推荐答案

在Matlab上提供的无法识别MinGW安装的详细信息有点含糊,但我会对此加以介绍.

The details provided on Matlab not recognizing the MinGW installation are a bit vague, but I'll take a shot at it.

安装MinGW时,默认安装目录是路径(程序文件)中带有空格的目录.由于某些原因,Matlab不支持此功能(

When installing MinGW, the default installation directory is one with spaces in the path (Program Files). For some reason, this is not supported by Matlab (https://www.mathworks.com/help/matlab/matlab_external/compiling-c-mex-files-with-mingw.html):

请勿将MinGW安装在路径名称中带有空格的位置.例如,不要使用:C:\ Program Files \ TDM-GCC-64

Do not install MinGW in a location with spaces in the path name. For example, do not use: C:\Program Files\TDM-GCC-64

在我的情况下,我将MinGW直接安装在C驱动器上.因此,我的安装目录具有以下布局:

In my situation, I installed MinGW directly on the C drive. As such, my installation directory has the following layout:

C:\ mingw64

C:\mingw64

  • C:\ mingw64 \ bin
  • C:\ mingw64 \ etc
  • C:\ mingw64 \ * ...

安装完成后,只需将Matlab指向安装目录,就我而言,我需要运行以下命令:

Once that is installed, all you need to do is point Matlab to the installation directory, in my case, I need to run the following command:

setenv('MW_MINGW64_LOC','C:\mingw64')

在那之后,您应该摆平脚步以运行mex编译命令.

After that, you should be squared away to run the mex compilation command.

这篇关于如何安装MinGW-w64 C/C ++编译器以在MATLAB 2016b中使用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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