主要内容

validate

验证编译工具属性

语法

validtool = h.validate

说明

validtool = h.validate 验证 coder.make.BuildTool 对象,如果任何属性定义不正确则生成错误。

输入参数

全部展开

coder.make.BuildTool 对象的对象句柄,指定为变量。

示例: tool

输出参量

全部展开

coder.make.BuildTool 对象的有效性。如果该方法检测到问题,它返回 '0' 或错误消息。

示例

如果您尝试在安装编译工具软件(编译器、链接器、归档器)之前验证编译工具,coder.make.BuildTool.validate 方法会返回警告和错误消息。

向 MATLAB® Coder™ 编译过程添加自定义工具链示例开始,输入以下几行:

tc = intel_tc;
tool = tc.getBuildTool('C Compiler');
tool.validate

如果您的主机没有安装 Intel® 工具链,validate 会显示以下消息:

Warning: Validation of build tool 'Intel C Compiler' may require the toolchain
to be set up first. The setup information is registered in the toolchain
this build tool belong to. Pass the parent ToolchainInfo object to VALIDATE
in order for any toolchain setup to be done before validation. 
> In C:\Program Files\MATLAB\R2013a\toolbox\coder\foundation\build\+coder\+make\
BuildTool.p>BuildTool.checkForPresence at 634
  In C:\Program Files\MATLAB\R2013a\toolbox\coder\foundation\build\+coder\+make\
BuildTool.p>BuildTool.validate at 430 
Error using message
In 'CoderFoundation:toolchain:ValidateBuildToolError',data type supplied is
incorrect for parameter {1}.

Error in C:\Program
Files\MATLAB\R2013a\toolbox\coder\foundation\build\+coder\+make\
BuildTool.p>BuildTool.checkForPresence
(line 664)


Error in C:\Program
Files\MATLAB\R2013a\toolbox\coder\foundation\build\+coder\+make\
BuildTool.p>BuildTool.validate
(line 430)

 
Trial>> 

有关详细信息,请参阅Troubleshooting Custom Toolchain Validation

版本历史记录

在 R2013a 中推出