When generating code from a model that uses a minmax block, MATLAB/RTW throws out the following warning.
The model is a SW Component on autosar.tlc target, Matlab 2013b
Warning: The following error occurred while attempting to run the preprocessor to find the minimum needed set of include files:
While parsing the source file 'C:\repository\trunk\src\MySwc\MySwc_autosar_rtw\stub\Rte_MySwc_calib.c' the following error occurred
C:\repository\trunk\src\MySwc\MySwc_autosar_rtw\MySwc.h:22: cannot open source file "Mfx.h"
#include "Mfx.h"
^
Reverting to full header search.
Looking to the generated code I see that there is a library function being used Mfx_Min_u32() to get the minimum between two signals corresponding to the minmax block inside the model.
Anyone knows why this happens? How can I avoid this and get rid of this Mfx_ library?
Thanks.

 採用された回答

Sandip Kumar
Sandip Kumar 2014 年 10 月 6 日

1 投票

This is happening because in Configuration Parameters > Code Generation > Interface > Code replacement library is set to AUTOSAR 4.0
Changing it to C89/C90 (ANSI) fixes the issue in R2013b.
With this change, the #include is not there and a basic less than equal to check in included in the generated C code.
The issue has been resolved in latest release i.e., R2014b.
Thanks, Sandip Kumar, MathWorks

2 件のコメント

Prashant Asati
Prashant Asati 2017 年 8 月 31 日
Recently I have faced this error. The model is a SW Component on autosar.tlc target, Matlab 2015b. The code is generated with Mfx_ library like below example Mfx_Sub_u16u16_u16(rbp_par_get_hmi_pass_Zone11MiddleDstMin_U16, rbp_par_get_hmi_pass_Zone11CutOffHysteresisMin_u16). While compiling the code getting error ""fatal error #5: could not open source file "Mfx.h" ""
Drew Patton
Drew Patton 2022 年 7 月 26 日
Changine the compiler from Autosar to the alternative (GNU) worked in version 2021b.

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

その他の回答 (1 件)

Chris Wiak
Chris Wiak 2016 年 8 月 16 日

0 投票

Do you know of a way to halt this warning and make it disappear? I am sure it is possible in the options of the model, not sure which one though. Thanks

カテゴリ

ヘルプ センター および File Exchange で Deployment, Integration, and Supported Hardware についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by