# The Simulink program fails to compile, while it compiles successfully in the Toolbox and WSL

**URL:** <https://discuss.px4.io/t/the-simulink-program-fails-to-compile-while-it-compiles-successfully-in-the-toolbox-and-wsl/48837>\
**Category:** PX4 Autopilot\
**Created:** [April 14, 2026, 1:35pm UTC](https://discuss.px4.io/t/the-simulink-program-fails-to-compile-while-it-compiles-successfully-in-the-toolbox-and-wsl/48837 "2026-04-14T13:35:44Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![a233a2](https://discuss.px4.io/user_avatar/discuss.px4.io/a233a2/32/17693_2.png) [@a233a2](https://discuss.px4.io/u/a233a2)\
**Post date:** [April 14, 2026, 1:35pm UTC](https://discuss.px4.io/t/the-simulink-program-fails-to-compile-while-it-compiles-successfully-in-the-toolbox-and-wsl/48837/1 "2026-04-14T13:35:44Z")

</div>

I’m using Pixhawk 6C to develop an algorithm using Simulink, but I’m encountering the following problem: The Simulink program fails to compile, while it compiles successfully in the Toolbox and WSL.

WSL is running Ubuntu 22.04, MATLAB is version 2025A, and PX4 is version 1.14.3.

The specific compilation error is as follows:

 ![image](https://discuss.px4.io/uploads/default/original/3X/6/a/6a144138508c670de01208682d07321479d25b0f.png)

### Simulink cache file “No4\_OutPWMinSTL.slxc” not found.

### Searching for referenced models in model ‘No4\_OutPWMinSTL’.

### Only 1 model needs to be built.

### Initiating the compilation process for No4\_OutPWMinSTL

### Generating code and artifacts for the ‘model-specific’ folder structure

### Generating code to the compilation folder: D:\PX4\_EXP\No4\_OutPWMinSTL\_ert\_rtw

### Invoking Target Language Compiler on No4\_OutPWMinSTL.rtw

### Using System Target File: D:\Software\_Use\MATLAB2025A\rtw\c\ert\ert.tlc

### Loading TLC function libraries

…

### Initial pass through model to cache user-defined code

### Caching model source code

…

### Writing header file No4\_OutPWMinSTL\_types.h

### Writing header file No4\_OutPWMinSTL.h

### Writing source file No4\_OutPWMinSTL.cpp

### Writing header file rtwtypes.h

### Writing header file rtGetNaN.h

.

### Writing source file rtGetNaN.cpp

### Writing header file rt\_nonfinite.h

### Writing source file rt\_nonfinite.cpp

### Writing header file rtGetInf.h

### Writing source file rtGetInf.cpp

.

### Writing header file No4\_OutPWMinSTL\_private.h

### Writing source file No4\_OutPWMinSTL\_data.cpp

### Writing header file rtmodel.h

### Writing source file ert\_main.cpp

### TLC code generation complete (took 1.148s).

### Saving binary information cache.

Removing old px4\_simulink\_app directory: \wsl.localhost\Ubuntu-22.04\home\sjy\mypx4\PX4-Autopilot\src\modules\px4\_simulink\_app.

Build path: D:\PX4\_EXP\No4\_OutPWMinSTL\_ert\_rtw

Warning: PX4 Firmware build not done for the selected cmake config, perform setup screens

### The compilation process for No4\_OutPWMinSTL was aborted due to an error.

Top-level model target:

Model Compilation reason Status Compilation duration

=================================================================== No4\_OutPWMinSTL information cache folder or artifact is missing. Unable to compile. See the build log for details. 0d

0 models compiled, out of 1 model (0 models are already up-to-date)

Compilation time: 0h 0m 9.2575s

PX4 Firmware build not done for the selected cmake config, perform setup screens

Component: Simulink | Category: Block diagram Error

---

<div class="post-metadata">

**Author:** ![system](https://discuss.px4.io/uploads/default/original/3X/7/3/73ce918bdcd64854de904f0c8d9ab70ca9723f2a.png) [@system](https://discuss.px4.io/u/system)\
**Post date:** [July 13, 2026, 2:01pm UTC](https://discuss.px4.io/t/the-simulink-program-fails-to-compile-while-it-compiles-successfully-in-the-toolbox-and-wsl/48837/3 "2026-07-13T14:01:50Z")

</div>

Closed on July 13, 2026, 2:01pm UTC

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
