本页面提供的是上一版软件的文档。当前版本中已删除对应的英文页面。
编译过程
设置编译器或 IDE、配置和启动编译过程、解决编译器错误
请选择并设置编译器或 IDE 并配置目标环境,然后才能为模型编译可执行程序或共享库。启动编译过程的方法有几种。可以利用工具重新加载、重新编译以及重新定位生成的代码。
如果您的系统包含引用模型,则可以减少编译时间并控制代码生成器是否为顶层模型重新生成代码。
要提高代码执行的速度,请考虑使用可用的探查功能。
函数
主题
编译过程工作流
- 编译从 Simulink 模型生成的代码的方法
选择 CMake、工具链或模板联编文件方法来编译生成的代码。 - Build Process Workflow for Real-Time Systems
Generate C code from a model and build an executable program. - Build Models from a Windows Command Prompt Window
Build models by running MATLAB with a batch file. - Rebuild a Model
Rebuild a model after customizing generated source code or makefiles. - Reload Generated Code
Reload generated code from the Model Explorer. - 在 Simulink 环境中编译集成的代码
在 Simulink 环境中添加支持文件和控制模型代码生成与编译。 - 转移或共享生成的代码
将生成的代码和工件打包并转移到其他开发环境中。 - 使用 Microsoft Visual Studio 编译和调试生成的 C 代码
根据模型编译 Visual Studio® 解决方案。
配置编译过程
- Configure CMake Build Process
Specify CMake toolchain definition for building generated code. - 配置工具链 (ToolchainInfo) 或模板联编文件编译过程
根据生成的代码编译可执行程序。 - Template Makefiles and Make Options
Template makefiles that are built into the code generator. - Select C or C++ Programming Language
Choose C or C++ as the programming language for code generation. - Select and Configure C or C++ Compiler
Consider programming language compliance for generated code and select a compiler for the build process. - Troubleshoot Compiler Issues
Identify and fix issues that prevent compiler operation in the build process. - 运行时环境配置
选择并配置与您的应用程序目标最匹配的目标环境。 - Reports for Code Generation
Access the generated code files and information about the generated code with the code generation report. - Configure Model for Debugging
Configure a model so that generated code and the build process are set for debugging.
编译过程注意事项
- 管理编译过程文件夹
管理代码生成器创建的文件夹。 - 管理编译过程文件
使用生成的源文件和代码生成器生成的依赖项文件。 - Manage Build Process File Dependencies
Work with generated source files and dependency files that the code generator produces. - Add Build Process Dependencies
Add dependency information for external code to the build process. - Build Process Support for File and Folder Names
Troubleshoot build process errors that occur when file system issues prevent file processing. - Executable Program Generation
Build executable programs with the code generator.