0

这是在 matlab 7.1 中构建 exe 文件的会话。

我想我的编译器有问题。

mbuild -setup

Please choose your compiler for building standalone MATLAB
applications:    Would you like mbuild to locate installed compilers
[y]/n? y


Select a compiler: 
[1] 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++ 2008 Express  
Location: C:\Program Files (x86)\Microsoft Visual Studio 9.0 

Are these correct [y]/n? y

***************************************************************************** 
Error: Could not find the 64-bit compiler.  This may indicate that the  
     "X64 Compilers and Tools" or the Microsoft Windows Software  
     Development Kit (SDK) is not installed.  To build 64-bit binaries,  
     Microsoft Visual C++ 2008 Express Edition requires that these two  
     packages be properly installed.  
***************************************************************************** 

Trying to update options file: C:\Users\****\AppData\Roaming\MathWorks\MATLAB\R2010a\compopts.bat 
From template:              C:\PROGRA~1\MATLAB\R2010a\bin\win64\mbuildopts\msvc90freecompp.bat 

Done . . . 

>> mcc -m mainmain.m -o mainmain
Could not find the compiler "cl" on the DOS path. 
Use mbuild -setup to configure your environment properly. 


C:\PROGRA~1\MATLAB\R2010A\BIN\MEX.PL: Error: Unable to locate compiler. 

Error: An error occurred while shelling out to mbuild (error code = 2). 
Unable to build executable (specify the -v option for more information). 
??? Error using ==> mcc
Error executing mcc, return status = 1 (0x1).

如果问题出在编译器上,我该如何安装另一个编译器?

我有 Windows 7(64 位),我希望 exe 文件可以在 Windows 操作系统上运行。

4

1 回答 1

1

这可能是两个问题之一的结果。

1) 您没有安装 Windows SDK(如错误消息中所示)。根据这个关于支持的编译器的 MathWorks页面

必须安装 Microsoft Visual Studio 2008 和 Windows 软件开发工具包 (SDK) 6.1。安装Microsoft Visual Studio时,安装Microsoft Visual Studio时必须选择“X64 Compilers and Tools”;默认情况下不选择此项。

现在,请记住,此参考适用于 MATLAB 的最新版本,但我敢打赌,此信息仍然与您的问题相关。

您可以在此处下载 SDK 。

2)您使用的编译器也可能不支持您的 MATLAB 版本。有关 MATLAB 7.1 支持的编译器的信息,请参阅此处

于 2012-09-30T16:37:17.443 回答