MATLAB: Install MinGW Compiler when both add-on and manual installation pocedures fail

mingwr2016ar2016b

The same Problem with both R2016a and R2016b 1) When installing MinGW from Matlab add-on manager, I get the error: C:\MATLAB\SupportPackages\R2016a\downloads\mingw_download does not contain archives for third-party software used by the support package. > In fact, the directory contains the mingw downloaded… but some remaining third-party software are still required !
2) When I try the manual aproach described here: http://fr.mathworks.com/matlabcentral/answers/313298-i-already-have-mingw-on-my-computer-how-do-i-configure-it-to-work-with-Matlab I am able to install MinGW on my computer. But configuration with Matlab fails with the error: No supported compiler or SDK was found. >

Best Answer

1) The first issue you are facing can sometimes occur if the third-party site is not reachable. For more information about this issue, look into the following MATLAB Answers post:
2) As MATLAB detects the MinGW Compiler through Environment Variable 'MW_MINGW64_LOC', verify if it is set properly by running the following command:
mex -v -setup C
If MinGW is configured correctly, the output of the above command should be along the following lines, while looking for MinGW:
... Looking for compiler 'MinGW64 Compiler (C)' ...
... Looking for environment variable 'MW_MINGW64_LOC' ...Yes('C:\MATLAB\SupportPackages\R2016a\MW_MinGW_4_9').
... Looking for file 'C:\MATLAB\SupportPackages\R2016a\MW_MinGW_4_9\bin\gcc.exe' ...Yes.
... Looking for folder 'C:\MATLAB\SupportPackages\R2016a\MW_MinGW_4_9' ...Yes.
Found installed compiler 'MinGW64 Compiler (C)'.
MEX configured to use 'MinGW64 Compiler (C)' for C language compilation.
If MATLAB is not able to find "gcc.exe", it is possible that MinGW is not installed correctly. You can reinstall MinGW again and check if it resolves the issue. Also, make sure that the MinGW version you are using is 4.9.2. I hope this helps!
Related Question