matlab用mcc生成exe程序出错了,执行到中途出错,之前还好好的,突然就这样,昨天用都没事成功了,

>> 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 F:\PROGRA~1\MATLAB\R2009a\sys\lcc
[2] Microsoft Visual C++ 6.0 in D:\Program Files\Microsoft Visual Studio

[0] None

Compiler: 1

Please verify your choices:

Compiler: Lcc-win32 C 2.4.1
Location: F:\PROGRA~1\MATLAB\R2009a\sys\lcc

Are these correct [y]/n? y

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

Done . . .

>> mcc -m VA_GUARD_GUI.m
'cmd' 不是内部或外部命令,也不是可运行的程序
或批处理文件。
Error: An error occurred while shelling out to mbuild (error code = 1).
Unable to build executable (specify the -v option for more information).
??? Error using ==> mcc
Error executing mcc, return status = 1 (0x1).
就今天用是这样,昨天还好好的。
各位大神谁知道什么原因?

第1个回答  2011-03-18
重新mbuild一遍,可以多试几次,算是人品测试吧

还有问题试一下自己安装的软件
比如
Select a compiler:
[1] Lcc-win32 C 2.4.1 in F:\PROGRA~1\MATLAB\R2009a\sys\lcc
[2] Microsoft Visual C++ 6.0 in D:\Program Files\Microsoft Visual Studio
选2

只有自己试一下
第2个回答  2011-03-23
建议用vc来编译追问

试过了,没用。会不会是生成了什么系统文件,或者在编译过程中损坏了什么系统文件,因为matlab重装了好几遍,而别的机子是好的,是可以编译运行的。

追答

应该是你的VC的问题,其实编译matlab程序是个鸡肋,在其他的电脑运行同时需要同时.net framework 和MCR的支持,MCR都100多MB,既然可以在其他的机器上可以编译,那就行了,也就是演示用一下

本回答被提问者采纳
第3个回答  2011-03-16
看不明白。。。。追问

最主要的是下面这个错误怎么形成的
>> mcc -m VA_GUARD_GUI.m
'cmd' 不是内部或外部命令,也不是可运行的程序
或批处理文件。
Error: An error occurred while shelling out to mbuild (error code = 1).
Unable to build executable (specify the -v option for more information).
??? Error using ==> mcc
Error executing mcc, return status = 1 (0x1).

相似回答