Matlab gui界面转exe出错,求解答!!!

Win7旗舰版下,在MATLAB(R2008a)中将gui转成exe,用mbuild-setup和mex-setup两个命令安装编译器VC6.0,都好使,但是键入mcc-... Win7旗舰版下,在MATLAB(R2008a)中将gui转成exe,用mbuild -setup和mex -setup两个命令安装编译器VC6.0,都好使,但是键入mcc -m filename(界面的 .m文件名)出现错误,如下:
>> mbuild -setup
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 E:\MATLAB2\R2008a\sys\lcc
[2] Microsoft Visual C++ 6.0 in E:\Program Files\Microsoft Visual Studio

[0] None

Compiler: 2

Please verify your choices:

Compiler: Microsoft Visual C++ 6.0
Location: E:\Program Files\Microsoft Visual Studio

Are these correct [y]/n? y

Trying to update options file: C:\Users\hp\AppData\Roaming\MathWorks\MATLAB\R2008a\compopts.bat
From template: E:\MATLAB2\R2008a\bin\win32\mbuildopts\msvc60compp.bat

Done . . .

>> mex -setup
Please choose your compiler for building external interface (MEX) files:

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

Select a compiler:
[1] Lcc-win32 C 2.4.1 in E:\MATLAB2\R2008a\sys\lcc\bin
[2] Microsoft Visual C++ 6.0 in E:\Program Files\Microsoft Visual Studio
[3] Open WATCOM C++ in E:\watcom-1.3

[0] None

Compiler: 2

Please verify your choices:

Compiler: Microsoft Visual C++ 6.0
Location: E:\Program Files\Microsoft Visual Studio

Are these correct [y]/n? y

Trying to update options file: C:\Users\hp\AppData\Roaming\MathWorks\MATLAB\R2008a\mexopts.bat
From template: E:\MATLAB2\R2008a\bin\win32\mexopts\msvc60opts.bat

Done . . .

**************************************************************************
Warning: The MATLAB C and Fortran API has changed to support MATLAB
variables with more than 2^32-1 elements. In the near future
you will be required to update your code to utilize the new
API. You can find more information about this at:
http://www.mathworks.com/support/solutions/data/1-5C27B9.html?solution=1-5C27B9
Building with the -largeArrayDims option enables the new API.
**************************************************************************

>> mcc -m hit_08211.m
hit_08211_main.c
hit_08211_main.c(9) : fatal error C1083: Cannot open include file: 'mclmcrrt.h': No such file or directory

E:\MATLAB7\\BIN\WIN32\MEX.PL: Error: Compile of 'hit_08211_main.c' failed.

Error: An error occurred while shelling out to mbuild (error code = 255).
Unable to build executable (specify the -v option for more information).
??? Error using ==> mcc
Error executing mcc, return status = 1.

这是什么原因,怎么解决?谢谢
展开
 我来答
百度网友1c6e06f
2010-10-11 · TA获得超过2894个赞
知道小有建树答主
回答量:695
采纳率:66%
帮助的人:685万
展开全部
我一般是按下面这个方法转exe的,没什么问题出现:

已有gui.m文件和gui.fig文件
1 在matlab的command窗口中输入
mcc -B sgl GUI.m
2.将上步生成的文件包括*m 文件和*.fig文件一起考到待运行的机器

此时仍需matlab所必需的动态连接库。
3. 将 <matlab path >/extern/lib/win32/mglinstallar.exel拷贝到到待运行机器上
如果是7.0以上版本,应该是MCRInstaller.exe,路径:<matlab path>\toolbox\compiler\deploy\win32\MCRInstaller.exe

4.在机器上先运行mglinstallar.exe, 然后选择解压目录,将在将在指定目录下解压缩出bin和toolbox两个子目录,
其中在bin\win32目录下就是数学库和图形库脱离MATLAB运行所需的所有动态连接库,共
有37个。可以将这些.dll考入system32, 也可以直接放在应用程序目录下。
而toolbox目录则必须与应用程序同一目录。
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
百度网友e56ba1038
2010-10-03 · TA获得超过2499个赞
知道小有建树答主
回答量:821
采纳率:0%
帮助的人:0
展开全部
2008版本的话,建议你使用deploytool,界面化的编译。

关于mcc,请注意:

Matlab只有几百个函数可以编译成exe文件,如果你使用到神经网络、Simulink等工具箱函数,暂时还不能完全编译成exe文件。

MathWorks公司会尽快给大家一个比较完整的答复。
本回答被提问者和网友采纳
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式