MATLB2014a编译exe遇到的问题解决方法(64位win7/10亲测)

1、按照网上说的运行mex -setup或者mbuild -setup,出现:
错误使用 mbuild (line 164),Unable to complete successfully.未找到支持的编译器或 SDK。有关选项,请访问http://www.mathworks.com/support/compilers/R2014a/win64。
然后打开http://www.mathworks.com/support/compilers/R2014a/win64链接,查找2014a对应的编译器要求,若没有安装VS,则可以选择安装:Mrcrosoft Windows SDK7.1和.Net FrameWork 4.0
MATLB2014a编译exe遇到的问题解决方法(64位win7/10亲测)
在https://www.microsoft.com/zh-cn/download/details.aspx?id=17718下载“.Net FrameWork 4.0”并安装,或者4.0之后的版本都是可以的。
在https://www.microsoft.com/en-us/download/details.aspx?id=8279下载“Microsoft Windows SDK for Windows 7 and .NET Framework 4”,此时先不要安装。
直接安装可能会出现以下错误:
1)“Some components cannot be installed” Some Windows SDK components require the RTM.NET
忽略此错误,直接点确定继续安装。
2)“A problem occurred while installing selected Windows SDK components.Installation of the “Microsoft Windows SDK for Windows 7” product has reported the following error: DeleteFileSafe failed (10th try)”
这是因为电脑上之前安装过VS2010或者VS2010的扩展包,需要先卸载掉。打开“开始”,选择“程序和功能”,打开“程序”列表,找到:
MATLB2014a编译exe遇到的问题解决方法(64位win7/10亲测)
将上述两个组件都卸载掉。然后安装刚才下载的“Mrcrosoft Windows SDK7.1”包。
然后,打开MATLAB2014a运行mex -setup时会出现:

这是因为刚才把VS2010相关的组件卸载了,打开“https://www.microsoft.com/en-us/download/details.aspx?id=13523”下载Microsoft Visual C++ 2010 SP1 Redistributable Package (x64),然后安装。
2、安装成功后,打开MATLAB2014a,运行