matlab中codegen是什么,matlab中mcc编译器参数的含义

创建动态链接库主要有两种方法: 一种是使用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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值