Why does mex -setup fail to locate the MinGW-64 SDK that I just installed from the Add-On explorer in Matlab R2017a?
38 views (last 30 days)
Show older comments
I just installed MinGW-64 using the Add-On explorer. I run mex -setup from the Matlab command prompt, and I get the following error message:
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/.
0 Comments
Answers (1)
Michelle Wu
on 13 Mar 2017
It is probably because the environment variable MW_MINGW64_LOC is not set correctly during installation. Usually this variable should be set with the path of the MinGW installation folder. However, on some systems where users have limited privileges, there may policies in place preventing environment variables from being set.
In order to see whether the MW_MINGW64_LOC environment variable is set, run the "mex" command in verbose mode:
mex -setup -v
The solution is to have an administrator set the variable.
Please refer to the following MATLAB Answers post for more information:
1 Comment
Walter Roberson
on 13 Mar 2017
I speculate you might have to exit MATLAB and re-enter for it to get the environment variable.
See Also
Categories
Find more on MATLAB Support for MinGW-w64 C/C++ Compiler 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!