mcc编译学习心得.docVIP

  • 9
  • 0
  • 约2.05万字
  • 约 4页
  • 2017-06-08 发布于河南
  • 举报
mcc编译学习心得

mcc编译学习心得 1. 当MATLAB用户一开始并不知道当前版本的MATLAB Compiler所支持的编译器类型有哪些时,需设置编译环境如下: mbuild -setup Please choose your compiler for building standalone MATLAB applications: Would you like mbuild to locate installed compilers [y]/n? n %输入 Select a compiler: [1] Borland C++Builder version 6.0 [2] Borland C++Builder version 5.0 [3] Borland C++Builder version 4.0 [4] Borland C++Builder version 3.0 [5] Borland C/C++ version 5.02 [6] Borland C/C++ version 5.0 [7] Borland C/C++ (free command line tools) version 5.5 [8] Lcc C version 2.4 [9] Microsoft Visual C/C++ version 7.1 [10] Microsoft Visual C/C++ version 7.0 [11] Microsoft Visual C/C++ version 6.0 [0] None Compiler: 11 %输入 Your machine has a Microsoft Visual C/C++ compiler located at C:\Program Files\Microsoft Visual Studio. Do you want to use this compiler [y]/n? y %输入 Please verify your choices: Compiler: Microsoft Visual C/C++ 6.0 Location: C:\Program Files\Microsoft Visual Studio Are these correct?([y]/n): y %输入 Try to update options file: C:\Documents and Settings\Administrator\Application Data\MathWorks\MATLAB\R14\compopts.bat From template: C:\MATLAB7\BIN\WIN32\mbuildopts\msvc60compp.bat Done . . . -- C:\MATLAB7\bin\win32\mwregsvr C:\MATLAB7\bin\win32\mwcomutil.dll DllRegisterServer in C:\MATLAB7\bin\win32\mwcomutil.dll succeeded -- C:\MATLAB7\bin\win32\mwregsvr C:\MATLAB7\bin\win32\mwcommgr.dll DllRegisterServer in C:\MATLAB7\bin\win32\mwcommgr.dll succeeded 至此,环境配置已经完成了. 2.简单也最常用的生成独立.EXE文件命令: mcc -m m文件名(如果主程序调用子程序时,要一起写进去) 例如: mcc -m pure ssimplex my_closereq 其中,pure,调了子程序ssimplex和 my_closereq 3. 可在它端计算机独立运行运行的方法: (1)方法一:就生成了独立EXE文件pure.m,把它与pure.ctf文件一起复制到MATLAB的安装目录\toolbox\compiler\deploy的目录中,或者也可以在每次编译后产生的mcr目录内的\toolbox\compiler\deploy的目录中搜索到.把deploy文件复制到它端计算机,都可以运行EXE文件. (2)方法二:把MATLAB的安装目录\toolbox\compiler\deploy\win32的MCRInstaller.exe文件复制把在它端计算机,并安装之,就可以把生成的独立执行exe文件复制过去,即可独立运行. 4. MATLAB保护文件(.p): (1)编译后的P文件比原与文件有相同的文件名,只是其扩展名为.p。而在MATLAB环境中P文件有比M文件较高

文档评论(0)

1亿VIP精品文档

相关文档