0

プロジェクトの .exe ファイルを生成するために Deploytool を使用して、Matlab で Windows スタンドアロン アプリケーションを作成しようとしています。(ここで述べたように: 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:

2 つのバージョンの Visual Studio がインストールされていますが、既定のコンパイラが MATLAB インストール ディレクトリにあることがわかります。

スクリプトがインストールされているコンパイラを見つけるように求めたら、必ず「y」と答えてください。

于 2011-11-10T13:56:50.253 に答える
0

コンピューターにコンパイラーをインストールする必要があります。ここから Visual Studio Express をダウンロードできます: Visual Studio Express Download

于 2011-11-10T13:26:28.747 に答える
0

コンピューターに Microsoft Visual Studio Ultimate をインストールしました。mbuild セットアップでコンパイラの場所を尋ねられたとき、私はそれを にリダイレクトしましたC:\Program Files (x86)\Microsoft Visual Studio 10.0。これは私にとってはうまくいきました。

于 2011-12-27T05:14:29.907 に答える