声振论坛

 找回密码
 我要加入

QQ登录

只需一步,快速开始

查看: 1433|回复: 4

[综合讨论] 求助:如何将m文件编译成exe文件

[复制链接]
发表于 2006-11-1 22:43 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?我要加入

x
我现在有两个m文件,一个是主文件,另一个是被调用的函数文件,请问怎么将他们编译成exe文件啊?在另一台未装matlab的机器上如何使用呢?

我用mcc -B sgl 命令编译主文件时,报错:
Error cloth_scope.c: 262  syntax error; found `end of input' expecting `}'
1 errors, 2 warnings

  MBUILD.BAT: Error: Compile of 'cloth_scope.c' failed.

??? Error using ==> mbuild
Unable to complete successfully

??? Error: An error occurred while shelling out to mbuild (error code = 1).
Unable to build executable (specify the -v option for more information).

Error in ==> D:\MATLAB6p5p1\toolbox\compiler\mcc.dll
这是怎么回事啊?程序在matlab中运行一切正常啊!

[ 本帖最后由 Leighton_buaa 于 2006-11-2 11:39 编辑 ]
回复
分享到:

使用道具 举报

发表于 2006-11-2 16:25 | 显示全部楼层
编译可执行文件的命令是:mcc -B sgl 主文件名(*.m)  调用的文件名(*.m)
还可以加上调试信息,其格式如下:mcc -B sgl -g 主文件名 调用的文件名
 楼主| 发表于 2006-11-3 16:14 | 显示全部楼层
原帖由 anneyholly 于 2006-11-2 16:25 发表
编译可执行文件的命令是:mcc -B sgl 主文件名(*.m)  调用的文件名(*.m)
还可以加上调试信息,其格式如下:mcc -B sgl -g 主文件名 调用的文件名

还是有如下的报错:found `end of input' expecting `}'
这应该是说在编译后的文件cloth_scope.c中的182行有错,找不到输入的结束,可在matlab中运行是对的阿!
Error cloth_scope.c: 182  syntax error; found `end of input' expecting `}'
Error cloth_scope.c: 182  syntax error; found `end of input' expecting `}'
Error cloth_scope.c: 182  syntax error; found `end of input' expecting `}'
Error cloth_scope.c: 182  syntax error; found `end of input' expecting `}'
Warning cloth_scope.c: 182  missing return value
Error cloth_scope.c: 182  syntax error; found `end of input' expecting `}'
Warning cloth_scope.c: 24  static `array 3 of double _array2_' is not referenced
Warning cloth_scope.c: 22  static `array 3 of double _array1_' is not referenced
Warning cloth_scope.c: 20  static `array 3 of double _array0_' is not referenced
5 errors, 5 warnings

  MBUILD.BAT: Error: Compile of 'cloth_scope.c' failed.

??? Error using ==> mbuild
Unable to complete successfully

??? Error: An error occurred while shelling out to mbuild (error code = 1).
Unable to build executable (specify the -v option for more information).

Error in ==> D:\MATLAB6p5p1\toolbox\compiler\mcc.dll
发表于 2006-11-3 19:04 | 显示全部楼层
这得需要英文翻译了
发表于 2006-11-3 19:29 | 显示全部楼层
原帖由 Leighton_buaa 于 2006-11-1 22:43 发表
我现在有两个m文件,一个是主文件,另一个是被调用的函数文件,请问怎么将他们编译成exe文件啊?在另一台未装matlab的机器上如何使用呢?

我用mcc -B sgl 命令编译主文件时,报错:
Error cloth_scope.c: 262 ...



先保证编译环境没有问题(即mbuild和mex都设置好),然后搜索一下论坛如何打包
您需要登录后才可以回帖 登录 | 我要加入

本版积分规则

QQ|小黑屋|Archiver|手机版|联系我们|声振论坛

GMT+8, 2024-9-25 03:23 , Processed in 0.051156 second(s), 17 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表