使用Visual Studio 2013的C编译器进行MATLAB [英] Using Visual Studio 2013's C compiler for 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屋!