首页 文章

Matlab部署工具 - Windows独立应用程序

提问于
浏览
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 回答

  • 0

    您需要允许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”

  • 1

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

  • 0

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

  • 0
    • 转到以下地址{C:\ Program Files \ MATLAB \ R2008a \ toolbox \ compiler \ deploy \ win32}

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

    请享用...

相关问题