MATLAB: Windows 7 (54) MATLAB 2017a: installing MinGW, .NET Framework SDK 4 and Microsoft Windows SDK 7.1 for use with mex and cpp

matlab coderMATLAB Compilermex compilermicrosoft .net framework sdkmicrosoft windows sdk 7.1mingw

On a Windows 7 (64bit) with MATLAB R2017a, I am trying to install MinGW, as well as Microsoft .NET Framework SDK 4.0 and Microsoft Windows SDK 7.1, so that I can convert cpp files with mex in MATLAB, in line with the compatible list https://uk.mathworks.com/support/compilers.html. Running
mex -v -setup
I am told that no supported compiler or SDK was found. Paths are found for MinGW and Microsoft Windows SDK 7.1, though none of the .exe files are in their folders after installation and are also not found by MATLAB.
I attempted to install MinGW through Add-Ons and did not receive any installation error messages. I also tried following this https://uk.mathworks.com/matlabcentral/answers/313286-why-do-i-see-a-java-util-zip-zipexception-error-in-my-installer-log-file-when-i-try-to-install-the. Following advice given here https://uk.mathworks.com/matlabcentral/answers/101105-how-do-i-install-microsoft-windows-sdk-7-1, I downloaded and installed Microsoft .NET Framework SDK 4.0 and Microsoft Windows SDK 7.1 here https://www.microsoft.com/en-us/download/details.aspx?id=8279.
The output from running `mex -v -setup' is as follows:
Verbose mode is on.
... Looking for compiler 'Intel C++ Composer XE 2013 with Microsoft SDK 7.1 (C)' ...
... Looking for environment variable 'ICPP_COMPILER14' ...No.
... Looking for environment variable 'ICPP_COMPILER13' ...No.
Did not find installed compiler 'Intel C++ Composer XE 2013 with Microsoft SDK 7.1 (C)'.
... Looking for compiler 'Intel C++ Composer XE 2013 with Microsoft Visual Studio 2012 (C)' ...
... Looking for environment variable 'ICPP_COMPILER14' ...No.
... Looking for environment variable 'ICPP_COMPILER13' ...No.
Did not find installed compiler 'Intel C++ Composer XE 2013 with Microsoft Visual Studio 2012 (C)'.
... Looking for compiler 'Intel C++ Composer XE 2013 with Microsoft Visual Studio 2013 (C)' ...
... Looking for environment variable 'ICPP_COMPILER14' ...No.
... Looking for environment variable 'ICPP_COMPILER13' ...No.
Did not find installed compiler 'Intel C++ Composer XE 2013 with Microsoft Visual Studio 2013 (C)'.
... Looking for compiler 'Intel Parallel Studio XE 2015 with Microsoft SDK 7.1 (C)' ...
... Looking for environment variable 'ICPP_COMPILER15' ...No.
Did not find installed compiler 'Intel Parallel Studio XE 2015 with Microsoft SDK 7.1 (C)'.
... Looking for compiler 'Intel Parallel Studio XE 2015 with Microsoft Visual Studio 2012 (C)' ...
... Looking for environment variable 'ICPP_COMPILER15' ...No.
Did not find installed compiler 'Intel Parallel Studio XE 2015 with Microsoft Visual Studio 2012 (C)'.
... Looking for compiler 'Intel Parallel Studio XE 2015 with Microsoft Visual Studio 2013 (C)' ...
... Looking for environment variable 'ICPP_COMPILER15' ...No.
Did not find installed compiler 'Intel Parallel Studio XE 2015 with Microsoft Visual Studio 2013 (C)'.
... Looking for compiler 'Intel Parallel Studio XE 2015 with Microsoft Visual Studio 2015 (C)' ...
... Looking for environment variable 'ICPP_COMPILER15' ...No.
Did not find installed compiler 'Intel Parallel Studio XE 2015 with Microsoft Visual Studio 2015 (C)'.
... Looking for compiler 'Intel Parallel Studio XE 2016 with Microsoft SDK 7.1 (C)' ...
... Looking for environment variable 'ICPP_COMPILER16' ...No.
Did not find installed compiler 'Intel Parallel Studio XE 2016 with Microsoft SDK 7.1 (C)'.
... Looking for compiler 'Intel Parallel Studio XE 2016 with Microsoft Visual Studio 2012 (C)' ...
... Looking for environment variable 'ICPP_COMPILER16' ...No.
Did not find installed compiler 'Intel Parallel Studio XE 2016 with Microsoft Visual Studio 2012 (C)'.
... Looking for compiler 'Intel Parallel Studio XE 2016 with Microsoft Visual Studio 2013 (C)' ...
... Looking for environment variable 'ICPP_COMPILER16' ...No.
Did not find installed compiler 'Intel Parallel Studio XE 2016 with Microsoft Visual Studio 2013 (C)'.
... Looking for compiler 'Intel Parallel Studio XE 2016 with Microsoft Visual Studio 2015 (C)' ...
... Looking for environment variable 'ICPP_COMPILER16' ...No.
Did not find installed compiler 'Intel Parallel Studio XE 2016 with Microsoft Visual Studio 2015 (C)'.
... Looking for compiler 'Intel Parallel Studio XE 2017 with Microsoft SDK 7.1 (C)' ...
... Looking for environment variable 'ICPP_COMPILER17' ...No.
Did not find installed compiler 'Intel Parallel Studio XE 2017 with Microsoft SDK 7.1 (C)'.
... Looking for compiler 'Intel Parallel Studio XE 2017 with Microsoft Visual Studio 2012 (C)' ...
... Looking for environment variable 'ICPP_COMPILER17' ...No.
Did not find installed compiler 'Intel Parallel Studio XE 2017 with Microsoft Visual Studio 2012 (C)'.
... Looking for compiler 'Intel Parallel Studio XE 2017 with Microsoft Visual Studio 2013 (C)' ...
... Looking for environment variable 'ICPP_COMPILER17' ...No.
Did not find installed compiler 'Intel Parallel Studio XE 2017 with Microsoft Visual Studio 2013 (C)'.
... Looking for compiler 'Intel Parallel Studio XE 2017 with Microsoft Visual Studio 2015 (C)' ...
... Looking for environment variable 'ICPP_COMPILER17' ...No.
Did not find installed compiler 'Intel Parallel Studio XE 2017 with Microsoft Visual Studio 2015 (C)'.
... Looking for compiler 'MinGW64 Compiler (C)' ...
... Looking for environment variable 'MW_MINGW64_LOC' ...Yes ('C:\ProgramData\MATLAB\SupportPackages\R2017a\MW_MinGW_4_9').
... Looking for file 'C:\ProgramData\MATLAB\SupportPackages\R2017a\MW_MinGW_4_9\bin\gcc.exe' ...No.
Did not find installed compiler 'MinGW64 Compiler (C)'.
... Looking for compiler 'Microsoft Visual C++ 2012 (C)' ...
... Looking for registry setting 'HKLM\SOFTWARE\Microsoft\VisualStudio\SxS\VS7' 11.0 ...No.
... Looking for registry setting 'HKCU\SOFTWARE\Microsoft\VisualStudio\SxS\VS7' 11.0 ...No.
... Looking for registry setting 'HKLM\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\SxS\VS7' 11.0 ...No.
... Looking for registry setting 'HKCU\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\SxS\VS7' 11.0 ...No.
Did not find installed compiler 'Microsoft Visual C++ 2012 (C)'.
... Looking for compiler 'Microsoft Visual C++ 2013 Professional (C)' ...
... Looking for registry setting 'HKLM\SOFTWARE\Microsoft\VisualStudio\SxS\VS7' 12.0 ...No.
... Looking for registry setting 'HKCU\SOFTWARE\Microsoft\VisualStudio\SxS\VS7' 12.0 ...No.
... Looking for registry setting 'HKLM\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\SxS\VS7' 12.0 ...No.
... Looking for registry setting 'HKCU\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\SxS\VS7' 12.0 ...No.
Did not find installed compiler 'Microsoft Visual C++ 2013 Professional (C)'.
... Looking for compiler 'Microsoft Visual C++ 2015 Professional (C)' ...
... Looking for registry setting 'HKLM\SOFTWARE\Microsoft\VisualStudio\SxS\VS7' 14.0 ...No.
... Looking for registry setting 'HKCU\SOFTWARE\Microsoft\VisualStudio\SxS\VS7' 14.0 ...No.
... Looking for registry setting 'HKLM\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\SxS\VS7' 14.0 ...No.
... Looking for registry setting 'HKCU\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\SxS\VS7' 14.0 ...No.
Did not find installed compiler 'Microsoft Visual C++ 2015 Professional (C)'.
... Looking for compiler 'Microsoft Windows SDK 7.1 (C)' ...
... Looking for registry setting 'HKLM\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v7.1' InstallationFolder ...Yes ('C:\Program Files\Microsoft SDKs\Windows\v7.1\').
... Looking for registry setting 'HKLM\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\SxS\VC7' 10.0 ...Yes ('C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\').
... Looking for file 'C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\amd64\cl.exe' ...No.
Did not find installed compiler 'Microsoft Windows SDK 7.1 (C)'.
Error using mex
No supported compiler or SDK was found. You can install the freely available
MinGW-w64 C/C++ compiler; see Install MinGW-w64 Compiler. For more options,
visit http://www.mathworks.com/support/compilers/R2017a/.

Best Answer

If UAC (User Account Control) is turned on Windows 7, the MinGW support package might say success, but the compiler may not be there and mex won't find it. The reason for this is that xcopy silently fails due to UAC being turned on.
Resolution is to turn off UAC. Please follow the below link to turn off UAC:
Try to reinstall MingW compiler and see if it works.
Related Question