Please choose your compiler for building external interface (MEX) files:
Would you like mex to locate installed compilers [y]/n? y
Select a compiler:
[1] Lcc-win32 C 2.4.1 in D:\MATLAB~1\sys\lcc
[2] Microsoft Visual C++ 6.0 in D:\Microsoft Visual Studio
[0] None
Compiler:
然后你选择相应的编译器并确认即可:
Compiler: 2
Please verify your choices:
Compiler: Microsoft Visual C++ 6.0
Location: D:\Microsoft Visual Studio
Are these correct [y]/n? y
Trying to update options file: C:\Users\faruto\AppData\Roaming\MathWorks\MATLAB\R2009b\mexopts.bat
From template: D:\MATLAB~1\bin\win32\mexopts\msvc60opts.bat
Done . . .
PS:matlab支持的编译器列表在这里查看:
http://www.mathworks.com/support/compilers/current_release/
这样就表示编译器选择成功了(此步骤中可能会出现warning警告是正常现象,不用管的说~)。
如果你输入 mex –setup后在
Please choose your compiler for building external interface (MEX) files:
Would you like mex to locate installed compilers [y]/n?
mex -setup
Please choose your compiler for building external interface (MEX) files:
Would you like mex to locate installed compilers [y]/n? n
Select a compiler:
[1] Intel C++ 9.1 (with Microsoft Visual C++ 2005 SP1 linker)
[2] Intel Visual Fortran 10.1 (with Microsoft Visual C++ 2005 SP1 linker)
[3] Lcc-win32 C 2.4.1
[4] Microsoft Visual C++ 6.0
[5] Microsoft Visual C++ .NET 2003
[6] Microsoft Visual C++ 2005 SP1
[7] Microsoft Visual C++ 2008 Express
[8] Microsoft Visual C++ 2008 SP1
[9] Open WATCOM C++
[0] None
Compiler: 4 %选择的这个编译器一定是你本机安装了的,否则选择了也没有用
Your machine has a Microsoft Visual C++ compiler located at
D:\Microsoft Visual Studio. Do you want to use this compiler [y]/n?
这样的话就可以手动选择你想要的编译器了,在
Your machine has a Microsoft Visual C++ compiler located at
D:\Microsoft Visual Studio. Do you want to use this compiler [y]/n?
Compiler: 4
Your machine has a Microsoft Visual C++ compiler located at
D:\Microsoft Visual Studio. Do you want to use this compiler [y]/n? n
Please enter the location of your compiler: [C:\Program Files\Microsoft Visual Studio]