How can I solve the compiler issue in matlab?

10 views (last 30 days)
I am using matlab R2013a 64-bit version in windows 8.1. When i tried to simulate .m file,i got an error.The error is "Unable to locate a C-compiler required by Stateflow and MATLAB Function blocks. Use 'mex -setup' to select a supported C-compiler".How can i solve this?

Accepted Answer

Walter Roberson
Walter Roberson on 13 Sep 2015
You read http://www.mathworks.com/support/compilers/R2013a/index.html?sec=win64 and install SDK7.1 and NET 4.0, or you install Microsoft Visual C++ 2012 Professional, or you install Microsoft Visual C++ 2010 Professional SP1, or you install Microsoft Visual C++ 2008 Professional SP1 and Windows SDK 6.1. And then after you install one of those you run
mex -setup
  3 Comments
Walter Roberson
Walter Roberson on 13 Sep 2015

https://support.microsoft.com/en-us/kb/2717426

AKHIL NATH
AKHIL NATH on 14 Sep 2015
Edited: Walter Roberson on 14 Sep 2015
Previously the error was unable to locate c compiler. I installed wnindows SDK 7.1 as per your instruction. But now another 3 errors are showing while running .m file. The errors are
1).Make-Making simulation target "nnwithbb_4_sfun", ... 'nnwithbb_4_sfun.bat' is not recognized as an internal or external command, operable program or batch file.
2).Parse -Parsing successful for machine: "nnwithbb_4"(#21)
3).Coder-Code Directory : "G:\Materials\MAIN PROJECT\nirupama\slprj\_sfprj\nnwithbb_4\_self\sfun\src"
Machine (#21): "nnwithbb_4" Target : "sfun"
Chart "PV module" (#23):
. "c2_nnwithbb_4.h"
"c2_nnwithbb_4.c"
"nnwithbb_4_sfun.h"
"nnwithbb_4_sfun.c"
"nnwithbb_4_sfun_debug_macros.h"
Interface and Support files:
"nnwithbb_4_sfun_registry.c"
Code generation successful for machine: "nnwithbb_4" The above 3 are the errors .What should i do?

Sign in to comment.

More Answers (0)

Categories

Find more on Troubleshooting in MATLAB Compiler SDK in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!