第1个回答 2016-07-15
首先先设定matlab所选定的compiler:
1. matlab command: mex -setup
(C:\Users\xxx\AppData\Roaming\MathWorks\MATLAB\R2010a\mexopts.bat 为预设的mex option file)
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] Microsoft Visual C++ 2008 SP1 in C:\Program Files (x86)\Microsoft Visual Studio 9.0
[0] None
Compiler: 1
Please verify your choices:
Compiler: Microsoft Visual C++ 2008 SP1
Location: C:\Program Files (x86)\Microsoft Visual Studio 9.0
Are these correct [y]/n? y
***************************************************************************
Warning: MEX-files generated using Microsoft Visual C++ 2008 require
that Microsoft Visual Studio 2008 run-time libraries be
available on the computer they are run on.
If you plan to redistribute your MEX-files to other MATLAB
users, be sure that they have the run-time libraries.
***************************************************************************
Trying to update options file: C:\Users\xxx\AppData\Roaming\MathWorks\MATLAB\R2010a\mexopts.bat
From template: C:\PROGRA~1\MATLAB\R2010a\bin\win64\mexopts\msvc90opts.bat
Done . . .
**************************************************************************