Original Address: http: //blog.sina.com.cn/s/blog_53c7b1580102xjcw.html
The old version of Matlab comes lcc, enter mex -setup in Matlab you can choose to set. If the computer has other C compilers like VC installation, Matlab will be listed for you to choose which compiler.
However, the high version of Matlab with them not so simple.
I used 2015b, enter mex -setup, suggesting:
"Error using mex
support was not found in the SDK compiler or you can install MinGW-w64 C / C ++ compiler provided free of charge; see Installing MinGW-w64 For compiler. For more options, see
http://www.mathworks.com/support/compilers/R2015b/win64.html.
"
I follow the instructions to the" additional features "go Add MinGW, the results of additional functions manager of a small fan page turn ah turn, it is to turn out.
Had no choice but Baidu has about MinGW-w64, several versions, installed a, regardless of use.
Later, a close look at the instructions Matlab, Matlab discovery supported version looks like this: so he went TDM-GCC (http://tdm-gcc.tdragon.net/download). After installation, still not working. Later, the Internet search, find the reasons. 1, I installed TDM-GCC is a 32-bit to 64-bit. Re-download, install (the installation should pay attention to the picture above to remove that option ticked). 2, but not enough, but also set the environment variable in the system properties. Computer → Properties → Advanced System Settings → Advanced, there is an environment variable, is this: point to open, under the election system variable "new", the variable name to write "MW_MINGW64_LOC", TDM-GCC directory installed before the value of the variable input is "C: \ TDM-GCC- 64". determine.
3, to set a temporary environment variables in Matlab Matlab, enter in Matlab:
setenv ( 'MW_MINGW64_LOC', 'C: \ the TDM-the GCC-64')
. 4, mex -setup C ++ and then enter it.
5, however, the Matlab environment variable seems to be temporary, so you can build a startup.m file in the home directory of Matlab, to set the environment variable statement in this m file so that it will automatically start every time Matlab executed.
The official explained that:
https://cn.mathworks.com/matlabcentral/answers/313298-i-already-have-mingw-on-my-computer-how-do-i-configure-it-to-work-with -matlab