请问在Matlab中选择VC6.0为编译器的方法

2025-03-12 17:39:36
推荐回答(1个)
回答1:

1. 安装
单独安装、和MATLAB同时安装。
2. 设置(以vs2005为例)
>> 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 D:\PROGRA~1\MATLAB\R2010a\sys\lcc
[2] Microsoft Visual C++ 2008 SP1 in D:\Program Files\Microsoft Visual Studio 9.0
[3] Microsoft Visual C++ 2005 SP1 in C:\Program Files\Microsoft Visual Studio 8

[0] None

Compiler: 3

Please verify your choices:

Compiler: Microsoft Visual C++ 2005 SP1
Location: C:\Program Files\Microsoft Visual Studio 8

Are these correct [y]/n?

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

Done . . .

3. 使用
(1)在 MATLAB 环境中使用 mcc 命令;
(2)在系统命令环境中使用 mcc.exe (在Windows上);
(3)在 MATLAB 环境中使用 Deployment Tool。
4. 程序发布
(1)使用 MATLAB 命令 builder;
(2)使用 Deployment Tool 图形化工具。
一般来说,需要发布的文件有3个:
(1)编译得到的可执行文件或库函数;
(2)CTF 文件;
(3)MCRInstaller.zip。
在最终用户的计算机上,首先需要把MCRInstaller.zip 解压,并把 MCR 中可执行文件所在目录添加到系统路径上,然后就可以使用编译后的程序了。