需要在matlab中使用c++编译器,直接安装matlab老是报错:
>> mex -setup
Welcome to mex -setup. This utility will help you set up
a default compiler. For a list of supported compilers, see
http://www.mathworks.com/support/compilers/R2011b/win64.html
Please choose your compiler for building MEX-files:
Would you like mex to locate installed compilers [y]/n? y
No supported SDK or compiler was found on this computer.
For a list of supported compilers, see
http://www.mathworks.com/support/compilers/R2011b/win64.html
Error using mex (line 206)
Unable to complete successfully.
折腾许久才装好,现将过程记录如下(以R2011b为例子)。
0、按照mathworks给出的解释,在安装matlab前首先需要安装windows sdk和vs2008
1、安装windows sdk
2、安装vs2008
选择自定义,在选择安装功能时,勾选“visual c++工具”选项下的“x64编译器和工具(x64 compilers and tools)”
3、安装64位matlabR2011b
(2)如果没有装过VC++的runtime库(Microsoft Visual C++ xxxx Redistributable Package),那么首先需要安装bin\win64下面的vcredist_x64.exe,否则会报如下错误:“应用程序无法启动,因为应用程序的并行配置不正确。有关详细信息,请参阅应用程序事件日志,或使用命令行sxstrace.exe工具。”
同时要注意,如果装了2005的runtime库不行的话,就尝试安装2008或者2010的runtime库。
(3)安装bin\win4目录下的setup.exe。
4、重启,在matlab中输入mex -setup,终于出现了c++的编译器