why embedded coder report "fatal error: cstring: No such file or directory" when i trying to build the code

10 ビュー (過去 30 日間)
瑶 王
瑶 王 2023 年 11 月 4 日
コメント済み: Arvind 2025 年 11 月 11 日
i am using byte packing block from simulink realtime blockset, and for code generation it will automaticly add #include <cstring> to the header file. once i am trying to compile the code, the simulink reports the "fatal error: cstring: No such file or directory" error and stops compiling.
i am tring to add <csting> into the include directory under the "simulation target" tab under Model Configuration, but i still have this issue.
is there any way to walk around this issue? how can i tell the compiler it should go to the dedicated directory to refer the <csting> ?
please let me know if you have any throught. thank you

回答 (1 件)

Govind KM
Govind KM 2024 年 9 月 6 日
From the question categories, I assume you are building code to deploy to TI C2000 board and encountering the specified error.
  • The “Byte Packing” block from “Simulink Real-Time” library is not supported for TI C2000. It is recommended to switch to using the “Byte Pack” block from the “Embedded Coder” library from the “Embedded Coder/Embedded Targets/Host Communication” path.
  • In case you are compiling the code using MinGW, this issue could be due to an incomplete installation of the compiler. Try installing the MinGW compiler using the Add-On Explorer, or one of the other supported ways listed on the MinGW File Exchange page: https://www.mathworks.com/matlabcentral/fileexchange/52848-matlab-support-for-mingw-w64-c-c-fortran-compiler
Hope this resolves the issue.
  1 件のコメント
Arvind
Arvind 2025 年 11 月 11 日
Thanks, I was unable to see the static memory usage stats in codegen report because of cstring header file was not located by Matlab. This header was included because byte reversal block. I removed that and stats were visible.

サインインしてコメントする。

製品


リリース

R2021b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by