我正在尝试使用 Visual Studio 2010 Professional 编译器在 MATLAB 中编译和运行 64 位应用程序。我知道程序和编译器都能正常工作,因为当我从 Visual Studio x64 命令提示符启动 matlab 时,我能够毫无问题地运行程序。
我已经运行 mex -setup 并选择了 2010 编译器,如下所示:
mex -setup 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++ 2010 in C:\Program Files (x86)\Microsoft Visual Studio 10.0
[2] Microsoft Visual C++ 2008 Express in C:\Program Files (x86)\Microsoft Visual Studio 9.0
[0] None
Compiler: 1
Please verify your choices:
Compiler: Microsoft Visual C++ 2010 Location: C:\Program Files (x86)\Microsoft Visual Studio 10.0
Are these correct [y]/n? y
************************************************************************* Warning: MEX-files generated using Microsoft Visual C++ 2010 require that Microsoft Visual Studio 2010 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\OEM\AppData\Roaming\MathWorks\MATLAB\R2010a\mexopts.bat From template: C:\PROGRA~1\MATLAB\R2010a\bin\win64\mexopts\msvc100opts.bat
Done . . .
不幸的是,这似乎不允许我运行 64 位应用程序。我收到有关 cl 预处理器命令的错误,这表明我没有使用 64 位编译器。有谁知道我可以如何配置它,这样我就不需要从 Visual Studio 2010 命令行运行 Matlab?我将不胜感激这方面的任何帮助。
提前非常感谢!
大学教师