Main Content

本页翻译不是最新的。点击此处可查看最新英文版本。

编译配置

编译设置的配置,例如输出文件的名称、位置、类型、语言

要控制和配置生成二进制代码的编译过程,需要使用许多参数和设置。这些设置用来控制一些属性,如输出的编译类型(MEX、lib、dll 或 exe),以及输出的语言是 C 还是 C++ 等等。其他编译设置允许您根据特定要求自定义编译输出,例如可读性、性能和外部代码集成。您可以从 App 或从命令行修改代码生成配置对象中的编译选项。使用 coder.config 创建配置对象。使用 open 在编辑 App 中打开对象。要从函数代码内指定其他编译文件和标志,请使用 coder.updateBuildInfo

函数

全部展开

coder.config创建 MATLAB Coder 代码生成配置对象
coder.updateBuildInfoUpdate build information object RTW.BuildInfo
target.addAdd target object to internal database
target.createCreate target object
target.exportExport target object data
target.getRetrieve target objects from internal database
target.removeRemove target object from internal database
target.upgradeUpgrade existing definitions of hardware devices
addCompileFlagsAdd compiler options to build information
addDefinesAdd preprocessor macro definitions to build information
addIncludeFilesAdd include files to build information
addIncludePathsAdd include paths to build information
addLinkFlagsAdd link options to build information
addLinkObjectsAdd link objects to build information
addNonBuildFilesAdd nonbuild-related files to build information
addSourceFilesAdd source files to build information
addSourcePathsAdd source paths to build information
addTMFTokensAdd template makefile (TMF) tokens to build information
removeSourceFilesRemove source files from build information object
findBuildArgFind a specific build argument in build information
findIncludeFilesFind and add include (header) files to build information
getBuildArgsGet build arguments from build information
getCompileFlagsGet compiler options from build information
getDefinesGet preprocessor macro definitions from build information
getFullFileListGet list of files from build information
getIncludeFilesGet include files from build information
getIncludePathsGet include paths from build information
getLinkFlagsGet link options from build information
getNonBuildFilesGet nonbuild-related files from build information
getSourceFilesGet source files from build information
getSourcePathsGet source paths from build information
setTargetProvidesMainDisable inclusion of code generator provided (generated or static) main.c source file during build
updateFilePathsAndExtensionsUpdate files in build information with missing paths and file extensions
updateFileSeparatorUpdate file separator character for file lists in build information

target.AliasCreate alternative identifier for target object
target.LanguageImplementationProvide C and C++ compiler implementation details
target.ObjectBase class for target types
target.ProcessorProvide target processor information
coder.ExternalDependencyInterface to external code

对象

coder.MexCodeConfigConfiguration parameters for MEX function generation from MATLAB code
coder.CodeConfigConfiguration parameters for C/C++ code generation from MATLAB code
coder.EmbeddedCodeConfigConfiguration parameters for C/C++ code generation from MATLAB code with Embedded Coder
coder.HardwareImplementationHardware-specific configuration parameters for C/C++ code generation from MATLAB code
coder.hardwareCreate hardware board configuration object for C/C++ code generation from MATLAB code
coder.ReplacementTypesConfiguration parameter to specify custom names for MATLAB built-in data types in C/C++ code generation
RTW.BuildInfoProvide information for compiling and linking generated code

targetManage target hardware and build tool information

主题

编译配置基础知识

特定编译选项

故障排除