使用Visual Studio 2013的C编译器进行MATLAB [英] Using Visual Studio 2013's C compiler for MATLAB

查看:1164
本文介绍了使用Visual Studio 2013的C编译器进行MATLAB的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 mex -setup 命令将Visual Studio 2013添加为MATLAB的默认C编译器。我添加了Visual Studio 2013使用我在互联网上找到的下载与以下说明。

I added Visual Studio 2013 as the default C compiler for MATLAB using the mex -setup command. I added Visual Studio 2013 using a download I found on the internet with the following instructions.

The files 
  * msvc120engmatopts.bat
  * msvc120opts.bat
  * msvc120opts.stp
should be copied to C:\Program Files\MATLAB\R2013a\bin\win64\mexopts .

The files 
  * msvc120compp.bat
  * msvc120compp.stp
should be copied to C:\Program Files\MATLAB\R2013a\bin\win64\mbuildopts .

我的MATLAB版本是R2011b,因此我替换了正确的路径。

My version of MATLAB is R2011b, so I replaced the path appropriately.

这里是我使用它运行一个C函数来验证编译器是否已经链接。

Here's me using it to run a C function to verify if the compiler has been linked.

日志文件

href =http://stackoverflow.com/a/12450944/1154689> answer

I found out about this method from this answer.

但是,当我使用Simulink模型中的MATLAB函数,我得到以下错误消息,就像我在VS2013编译器链接到MATLAB之前。

However, when I use a MATLAB function within a Simulink Model, I get the following error message just like I did before I linked the VS2013 compiler to MATLAB.

Unable to locate a C-compiler required by Stateflow and MATLAB Function blocks.
Use 'mex -setup' to select a supported C-compiler.


推荐答案

好的,所以唯一适用于我的版本的 MATLABR2011b 是Microsoft SDK 7.1,因为其他编译器对Windows 7 64位太旧。不支持MinGW-64位。虽然它在MATLAB上工作,但不被Stateflow识别。

Okay, so the only thing that works for my version of MATLAB "R2011b" is Microsoft SDK 7.1 since the other compilers are too old for Windows 7 64 bit. MinGW-64 bit is unsupported. Although it works on MATLAB it is not recognized by Stateflow.

所以我只是从 这里

So I just downloaded the .iso file from here.

如果您在安装SDK时遇到任何困难,请尝试

If you face any difficulty while installing the SDK, then try this.

这篇关于使用Visual Studio 2013的C编译器进行MATLAB的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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