如何编译脱离MATLAB环境的可执行文件
作者:佚名 来源:转载 发布时间:2008-7-31 8:58:36
1 安装编译器
>> 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 C version 2.4 in C:\MATLAB7\sys\lcc
[0] None
Compiler: 1
Please verify your choices:
Compiler: Lcc C 2.4
Location: C:\MATLAB7\sys\lcc
Are these correct?([y]/n): y
Try to update options file: C:\Documents and Settings\liu\Application Data\MathWorks\MATLAB\R14\mexopts.bat
From template: C:\MATLAB7\BIN\WIN32\mexopts\lccopts.bat
Done . . .
安装完毕
2 使用mcc命令创建exe文件
法1 mcc -m m文件名
法2 mcc -B sgl m文件名
注意:m文件必须是函数文件,而不能是脚本文件;该文件须放置在matlab的搜索路径下;m文件中最好不要包含汉字信息;生成是exe文件是在dos下运行的。
文章评论 (评论内容只代表网友观点,与本站立场无关!)

您当前的位置: