使用matlab编译器生成EXE文件

使用matlab编译器生成EXE文件

  (2012-09-03 16:58:15)
标签: 

杂谈

分类: matlab

首先确定安装了C/C++编译器
然后在command window中作如下设置:
>> mbuild -setup
Please choose your compiler for building standalone MATLAB applications:

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

Select a compiler:
[1] Lcc-win32 C 2.4.1
[2] Microsoft Visual C++ 6.0
[3] Microsoft Visual C++ .NET 2003
[4] Microsoft Visual C++ 2005 SP1
[5] Microsoft Visual C++ 2008 Express
[6] Microsoft Visual C++ 2008 SP1

[0] None

Compiler: 6

The default location for Microsoft Visual C++ 2008 SP1 compilers is C:\Program Files\Microsoft Visual Studio 9.0,
but that directory does not exist on this machine.

Use C:\Program Files\Microsoft Visual Studio 9.0 anyway [y]/n? n
Please enter the location of your compiler: [C:\Program Files\Microsoft Visual Studio 9.0] D:\Program Files\Microsoft Visual Studio 9.0

Please verify your choices:

Compiler: Microsoft Visual C++ 2008 SP1
Location: D:\Program Files\Microsoft Visual Studio 9.0

Are these correct [y]/n? y

****************************************************************************
Warning: Applications/components generated using Microsoft Visual Studio
2008 require that the Microsoft Visual Studio 2008 run-time
libraries be available on the computer used for deployment.
To redistribute your applications/components, be sure that the
deployment machine has these run-time libraries.
****************************************************************************

Trying to update options file: C:\Documents and Settings\feiyuan\Application Data\MathWorks\MATLAB\R2009a\compopts.bat
From template: D:\PROGRA~1\MATLAB\R2009a\bin\win32\mbuildopts\msvc90compp.bat

Done . . .

设置完后,即可创建EXE文件了。(以peak.m文件为例)
在command window中输入:
mcc -m peak.m
这样在你设置的目录中即可生成一个名为peak的EXE文件。
注意:

  • mcc -m peak.m命令中mcc与-之间有空格;
  • 只有M函数文件才能生成EXE文件
  • 如果在M文件的第一行有注释,在执行mcc -m后,会有如下提示:
    Warning: MATLAB Toolbox Path Cache is out of date and is not being used.
    Type ‘help toolbox_path_cache’ for more info
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值