matlab转换为exe文件,matlab GUI程序转换成exe可执行文件

>> mcc -vm plus_test.m

Compiler version: 4.7 (R2007b)

Processing D:\MATLAB\R2007b\toolbox\matlab\mcc.enc

Processing include files...

2 item(s) added.

Processing directories installed with MCR...

The file mccExcludedFiles.log contains a list of functions excluded from the CTF archive.

1 item(s) added.

Generating MATLAB path for the compiled application...

Created 35 path items.

Begin validation of MEX files: Tue Jul 06 17:45:26 2010

Validating 'D:\MATLAB\R2007b\toolbox\compiler\deploy\deploywhich.mexw32'.

No conflicting M-file found.

Validating 'D:\MATLAB\R2007b\toolbox\compiler\deploy\readline.mexw32'.

No conflicting M-file found.

End validation of MEX files: Tue Jul 06 17:45:26 2010

Deleting 2 temporary MEX authorization files.

Removing: 'C:\DOCUME~1\LENOVO~1\LOCALS~1\Temp\mathworks_tmp_6122_12236.auth'.

Removing: 'C:\DOCUME~1\LENOVO~1\LOCALS~1\Temp\mathworks_tmp_28968_12236.auth'.

Parsing file "C:\Documents and Settings\lenovo-13\My Documents\MATLAB\exe_test\plus_test.m"

(Referenced from: "Compiler Command Line").

Parsing file "D:\MATLAB\R2007b\toolbox\compiler\deploy\deployprint.m"

(Referenced from: "Compiler Command Line").

Parsing file "D:\MATLAB\R2007b\toolbox\compiler\deploy\printdlg.m"

(Referenced from: "Compiler Command Line").

Generating file "plus_test_main.c".

Generating file "C:\Documents and Settings\lenovo-13\My Documents\MATLAB\exe_test\readme.txt".

Generating file "plus_test_mcc_component_data.c".

Executing command: mbuild -O -v -output "plus_test" "plus_test_main.c" "plus_test_mcc_component_data.c" -link exe

This is mbuild Copyright 1984-2006 The MathWorks, Inc.

-> Default options filename found in C:\Documents and Settings\lenovo-13\Application Data\MathWorks\MATLAB\R2007b

----------------------------------------------------------------

->    Options file           = C:\Documents and Settings\lenovo-13\Application Data\MathWorks\MATLAB\R2007b\compopts.bat

->    COMPILER               = lcc

->    Compiler flags:

COMPFLAGS           = -c -Zp8 -I"D:\MATLAB\R2007b\sys\lcc\include" -noregistrylookup

OPTIMFLAGS          = -DNDEBUG

DEBUGFLAGS          = -g4

arguments           =

Name switch         = -Fo

->    Pre-linking commands   =

->    LINKER                 = lcclnk

->    Link directives:

LINKFLAGS           = -tmpdir "." -L"D:\MATLAB\R2007b\sys\lcc\lib" -libpath "D:\MATLAB\R2007b\extern\lib\win32\lcc" -subsystem windows

LINKFLAGSPOST       = mclmcrrt.lib

Name directive      = -o "plus_test.exe"

File link directive =

Lib. link directive =

Rsp file indicator  = @

->    Resource Compiler      =

->    Resource Linker        =

----------------------------------------------------------------

--> "lcc  -c -Zp8 -I"D:\MATLAB\R2007b\sys\lcc\include" -noregistrylookup -FoC:\DOCUME~1\LENOVO~1\LOCALS~1\Temp\mbuild_1EF3788B-9F7F-4A4C-CA89-E7C7B5698A75\plus_test_main.obj -ID:\MATLAB\R2007b\extern\include -ID:\MATLAB\R2007b\simulink\include -DNDEBUG plus_test_main.c"

--> "lcc  -c -Zp8 -I"D:\MATLAB\R2007b\sys\lcc\include" -noregistrylookup -FoC:\DOCUME~1\LENOVO~1\LOCALS~1\Temp\mbuild_1EF3788B-9F7F-4A4C-CA89-E7C7B5698A75\plus_test_mcc_component_data.obj -ID:\MATLAB\R2007b\extern\include -ID:\MATLAB\R2007b\simulink\include -DNDEBUG plus_test_mcc_component_data.c"

Contents of C:\DOCUME~1\LENOVO~1\LOCALS~1\Temp\mbuild_1EF3788B-9F7F-4A4C-CA89-E7C7B5698A75\mbuild_tmp.rsp:

C:\DOCUME~1\LENOVO~1\LOCALS~1\Temp\mbuild_1EF3788B-9F7F-4A4C-CA89-E7C7B5698A75\plus_test_main.obj  C:\DOCUME~1\LENOVO~1\LOCALS~1\Temp\mbuild_1EF3788B-9F7F-4A4C-CA89-E7C7B5698A75\plus_test_mcc_component_data.obj

--> "lcclnk -o "plus_test.exe" -tmpdir "." -L"D:\MATLAB\R2007b\sys\lcc\lib" -libpath "D:\MATLAB\R2007b\extern\lib\win32\lcc" -subsystem windows  @C:\DOCUME~1\LENOVO~1\LOCALS~1\Temp\mbuild_1EF3788B-9F7F-4A4C-CA89-E7C7B5698A75\mbuild_tmp.rsp  mclmcrrt.lib"

--> "if exist C:\DOCUME~1\LENOVO~1\LOCALS~1\Temp\mbuild_1EF3788B-9F7F-4A4C-CA89-E7C7B5698A75\templib.def del C:\DOCUME~1\LENOVO~1\LOCALS~1\Temp\mbuild_1EF3788B-9F7F-4A4C-CA89-E7C7B5698A75\templib.def"

--> "if exist C:\DOCUME~1\LENOVO~1\LOCALS~1\Temp\mbuild_1EF3788B-9F7F-4A4C-CA89-E7C7B5698A75\templib_stub.obj del C:\DOCUME~1\LENOVO~1\LOCALS~1\Temp\mbuild_1EF3788B-9F7F-4A4C-CA89-E7C7B5698A75\templib_stub.obj"

Error: An error occurred while shelling out to mbuild (error code = 1).

Unable to build executable.

??? Error using ==> mcc

Error executing mcc, return status = 1.

这是什么原因啊  2007a 2009a都是如此

Simulink生独立的exe文件的一些方法-EclipseStepByStep_v2_final.ppt 最近有很多会员发帖提问这个问题,现在我集中说明一下。 Simulink产生的一般是mdl文件。 那么如何把这些mdl文件,制作exe文件? 其实这里面有一个过程: mdl文件 ——》第三方程序(比如说c,或者是java,或者是c 等等 -》编译exe文件 这样做的好处是,在中间这个过程当中,你可以加一些另外的程序,这样可以实现整个系统的自动化。 当然,即使你不加,也没有关系。 那么我们通常用eclipse来编译这些程序(因为是免费的,不像微软那些程序,很贵,而且兼容性好,可以实现跨平台) 这里,是一个使用eclipse建立project的ppt文件,讲的很详细,一步一步走即可: EclipseStepByStep_v2_final.ppt (838.5 KB, 下载次数: 182771) 2009-1-13 14:21 上传 点击文件名下载附件 =================================================================================== 好了,现在有了编译环境以后,下一步就是如何把mdl文件转换C语言(当然,其他语言也可以) 大家看一下下面这个图形: 登录/注册后可看大图 matlab34.jpg (60.87 KB, 下载次数: 2723) 下载附件  保存到相册 2009-1-13 14:24 上传 其实只是用到了一个Real time workshop的工具箱。 有些会员就说,我的程序不需要real time怎么办? 这里面,大家有一个理解上的错误,永远记住这句话: 一个系统支持Real Time,那么它肯定支持非Real Time 那么这个候,你只要看一下帮助里面,Real Time Workshop是如何把simulink代码生c代码就可以。 当然,从命令手讲的话,也就是emlc命令。 这里面牵涉到很多变量的转换问题,必须你亲自尝试了,才能明白,有所体会! rtw_gs.pdf (1.09 MB, 下载次数: 168263) 2009-1-13 14:34 上传 点击文件名下载附件 Real Time Workshop帮助文件
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值