Preamble: I found a solution in the middle of writing this, and this problem was PITA and had a difficult solution. So I feel compelled to leave it here to help any poor soul who has this problem.
I'm new to MatLab and I usually don't use Visual C ++, so goodbye if this should be painfully obvious.
Short version: I have Visual C ++ 2013 installed on my computer, but mex cannot find it when I run mex -setup c++ . I get the following:
>>mex -setup cxx
Error using mex
No supported compiler or SDK found. You can install the freely available MinGW-w64 C / C ++ compiler; see Installing the MinGW-w64 Compiler. For more options, see http://www.mathworks.com/support/compilers/R2015b/win64.html .
Here is the full situation.
- OS: Windows 10 Home
- Compiler: Visual Studio 2013 (v120, current)
- I have confirmed that I can compile and run the program using this toolkit.
- MatLab Version: 2015b
I originally ran Visual Studio 2015, and mex found the compiler just fine. However, I soon learned that Simulink is not compatible with VS 2015, so I had to return to VS 2013, and that was when my problem started.
I tried, among many others, the following sites to find a solution:
Then I went down the rabbit hole.
A very protracted response by mathworks.com that suggested other links . It led me to ...
Another mathworks.com answer that sounds like my problem and suggests fixing my installation. It turns out I do not have SDK 7.1. So, I went to the installation and got this error:
Some components cannot be installed. Some Windows SDK components require RTM.NET Framework 4 ...
This stack overflow question asks about this problem, and I got into the same Danilo Gadêlha problem regarding the already installed .NET Framework.
I tried the best answer , and after removing every link to the .NET framework of any version that I could find, including in the "Windows Features" section, I still could not install it.
I tried the following option , and even in safe mode, RegEdit did not allow me to change the values suggested in the next answer, so it was a recession.
Finally, I tried the MandM solution , which finally solved my chain of problems.
source share