Cannot open source file "Mfx.h", #include "Mfx.h"

5 visualizaciones (últimos 30 días)
bdorneanu
bdorneanu el 2 de Oct. de 2014
Comentada: Drew Patton el 26 de Jul. de 2022
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.

Respuesta aceptada

Sandip Kumar
Sandip Kumar el 6 de Oct. de 2014
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 comentarios
Prashant Asati
Prashant Asati el 31 de Ag. de 2017
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 el 26 de Jul. de 2022
Changine the compiler from Autosar to the alternative (GNU) worked in version 2021b.

Iniciar sesión para comentar.

Más respuestas (1)

Chris Wiak
Chris Wiak el 16 de Ag. de 2016
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

Categorías

Más información sobre Simulink Coder en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by