许可优化
许可优化
产品
产品
解决方案
解决方案
服务支持
服务支持
关于
关于
软件库
当前位置:服务支持 >  软件文章 >  Matlab中codegen与mcc编译器区别:代码生成参数详解

Matlab中codegen与mcc编译器区别:代码生成参数详解

阅读数 26
点赞 0
article_banner

创建动态链接库主要有两种方法: 一种是使用Matlab 为VC++

IDE提供的Add-in。这种方法比较简单,方便快捷,只要在VC++中创建工程的时候选择Matlab Project

Wizard,并且在接下来的Step 1 中的Visual Matlab Application Type选择Shared M-DLL

就可以了。接下来就是添加*.m 文件, 进行编译了。另一种方法就是使用Matlab 的mcc 命令将*.m文件编译为动态链接库(

*.DLL)。因为Add-in 也是调用Compiler 的命令mcc 进行编译工作的, 而且有时候这个Add-in

还会出现不能使用的情况, 因此这里主要讨论使用mcc 命令的方法。

关于mcc 有很多参数可以使用, 而且有多种用法,主要参数如下:

Bold entries in the Comment/Options column indicate default

values

-a filename

Add filename to the CTF archive

-b

Generate Excel-compatible formula function

Requires MATLAB Builder for Excel

-B filename[:arg[,arg]]

Replace -B filename on the mcc command line with the contents of

filename

The file should contain only mcc command line options. These are

MathWorks included options files:

-B csharedlib:fooC shared library

-B cpplib:fooC++ library

-c

生成C语言包装函数

Equivalent to

-T codegen

-d directory

输出到指定目录

-f filename

Use the specified options file, filename, when calling

mbuild

mbuild -setup is recommended.

-g

生成 debugging 信息

-G

同 -g

-I directory

Add directory to search path for M-files

MATLAB path is automatically included when running from MATLAB,

but not when running from DOS/UNIX shell.

-l

创建库函数的宏

等效于命令

-W lib -T link:lib

-m

生成C语言独立运行程序的宏

等效于命令

-W main -T link:exe

-M string

传递字符串给 mbuild

Use to define compile-time options.

-N

Clear the path of all but a minimal, required set of

directories

-o outputfile

制定最终可执行文件的名字

Adds appropriate extension

-P directory

Add directory to compilation path in an order-sensitive

context

Requires -N option

-R option

Specify run-time options for MCR

option =

-nojvm

-nojit

-S

Create Singleton MCR

Requires MATLAB Builder for COM

-T target

Specify output stage

target

=codegen compile:bin link:bin

where bin =exe

lib

-v

显示详细; 显示编译步骤

-w option

显示警告信息

option = list

level level:string

where level =disable

enable

error

-W type

Control the generation of function wrappers

type

= main cpplib:

lib:

none com:compname,clname,version

-Y licensefile

Use licensefile when checking out a Compiler license

-z path

指定库文件和包含文件的路径

-?

显示帮助信息

Feedback


免责声明:本文系网络转载或改编,未找到原创作者,版权归原作者所有。如涉及版权,请联系删

相关文章
技术文档
QR Code
微信扫一扫,欢迎咨询~
customer

online

联系我们
武汉格发信息技术有限公司
湖北省武汉市经开区科技园西路6号103孵化器
电话:155-2731-8020 座机:027-59821821
邮件:tanzw@gofarlic.com
Copyright © 2023 Gofarsoft Co.,Ltd. 保留所有权利
遇到许可问题?该如何解决!?
评估许可证实际采购量? 
不清楚软件许可证使用数据? 
收到软件厂商律师函!?  
想要少购买点许可证,节省费用? 
收到软件厂商侵权通告!?  
有正版license,但许可证不够用,需要新购? 
联系方式 board-phone 155-2731-8020
close1
预留信息,一起解决您的问题
* 姓名:
* 手机:

* 公司名称:

姓名不为空

姓名不为空

姓名不为空
手机不正确

手机不正确

手机不正确
公司不为空

公司不为空

公司不为空