0

我正在尝试使用 Deploytool 在 Matlab 中创建一个 Windows 独立应用程序来为我的项目生成一个 .exe 文件。(如此处所述:http: //www.mathworks.co.uk/products/demos/compiler/deploytool/index.html)。

问题是当我在 Deploytool 中添加我的文件并按下 Build 按钮时,它要求我使用 mbuild -setup 来设置我的编译器。当我这样做时,我得到的唯一选择是:

Would you like mbuild to locate installed compilers [y]/n? n


    Select a compiler:   
    [1] Microsoft Visual C++ 2005 SP1   
    [2] Microsoft Visual C++ 2008 Express   
    [3] Microsoft Visual C++ 2008 SP1   
    [0] None

当我选择任何我得到这些:

*The default location for Microsoft Visual C++ 2008 Express compilers is C:\Program Files (x86)\Microsoft Visual Studio 9.0, 
but that directory does not exist on this machine.  
Please enter the location of your compiler:*

我在构建时也收到以下错误:

*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.*

你能帮我解决这个问题吗?

提前致谢。

4

4 回答 4

1

您需要允许 mbuild 检测已安装的编译器。Matlab 编译器包括一个默认的 C 编译器。在我的 Windows XP 系统上,我得到:

    >> mbuild -setup

Welcome to mbuild -setup.  This utility will help you set up  
a default compiler.  For a list of supported compilers, see  
http://www.mathworks.com/support/compilers/R2011a/win32.html 

Please choose your compiler for building standalone MATLAB applications: 

Would you like mbuild to locate installed compilers [y]/n? y

Select a compiler: 
[1] Lcc-win32 C 2.4.1 in C:\PROGRA~1\MATLAB\R2011a\sys\lcc 
[2] Microsoft Visual C++ 2010 in C:\Program Files\Microsoft Visual Studio 10.0 
[3] Microsoft Visual C++ 2005 SP1 in C:\Program Files\Microsoft Visual Studio 8 

[0] None 

Compiler:

我安装了两个版本的 Visual Studio,但你可以看到默认编译器在 MATLAB 安装目录中。

当脚本要求查找已安装的编译器时,请确保您回答“y”

于 2011-11-10T13:56:50.253 回答
0

我在我的计算机上安装了 Microsoft Visual Studio Ultimate。当在 mbuild 设置中询问编译器的位置时,我将其重定向到C:\Program Files (x86)\Microsoft Visual Studio 10.0. 这对我有用。

于 2011-12-27T05:14:29.907 回答
0

您需要在计算机上安装编译器。您可以从此处下载 Visual Studio Express:Visual Studio Express 下载

于 2011-11-10T13:26:28.747 回答
0
  • 转到以下地址 {C:\Program Files\MATLAB\R2008a\toolbox\compiler\deploy\win32 }

    并安装以下设置 - “MCRInstaller.exe”(此设置文件用于设置运行时编译器)安装后您可以使用“部署工具”您各自的文件,如 *.Project。

享受...

于 2014-07-29T14:44:43.357 回答