"Unable to locate a C-compiler required by Stateflow and MATLAB Function blocks.Use 'mex -setup' to select a supported C-compiler."
使用mex -setup 选择VS2012之后还是出错,使用低版本2010a或者高版本2014b时可以运行。
参考Mathworks的官方支持,发现bug及解决方案如下:
Summary
Stateflow charts and MATLAB Function blocks do not work with Microsoft Visual Studio (MSVC) 2012.
Description
When you select Microsoft Visual Studio (MSVC) 2012 as your MEX compiler, you get an error if you try to update a Simulink model that contains Stateflow charts or MATLAB Function blocks. Here is the error message:
"Unable to locate a C-compiler required by Stateflow and MATLAB Function blocks.Use 'mex -setup' to select a supported C-compiler."Workaround
Installation instructions
Log in to an account with apPRopriate permissions to overwrite files in your MATLAB installation.Locate your MATLAB installation by typing matlabroot at the MATLAB command prompt. This folder is referred to as <MATLAB> in subsequent steps.Exit MATLAB.Download the attached .zip file associated with this Bug Report and store the file in the <MATLAB> folder.Make a backup copy of each of the files listed in the .zip file. To see the contents of the .zip file:Windows Systems*: Open the .zip file and look at the contents.Extract the files from the .zip file.Windows Systems*:Open the .zip file.Extract the contents of the file to your <MATLAB> folder.Delete the .zip file in the <MATLAB> folder.Launch MATLAB and run "mex -setup" in the command window. Select MSVC 2012 as the default compiler.*Notes for Windows Systems:
If you see “Error: access is denied” when attempting to extract the .zip file, you may need to start WinZip in administrator mode. Do this by navigating to WinZip.exe or the WinZip Start menu entry, right-clicking on it, and selecting Run as administrator.From within WinZip, find and open the downloaded .zip file.Extract the contents of the file to your <MATLAB> folder.Change log::
May 10, 2013: attachment_931218_13a_2013-05-10.zip: initial version, works on R2013a only.Fix
This bug was fixed as of R2013b(8.2).
If you have a current subscription to MathWorks Software Maintenance Service (SMS), you can download product updates. If not, learn more about MathWorks SMS.
Attachments
attachment_931218_13a_2013-05-10.zipExists in
Product Name | Release (Version) |
---|---|
Simulink | R2013a (8.1) |
或者到这里http://download.csdn.net/detail/u012565167/9767015
新闻热点
疑难解答