Cannot open source file "Mfx.h", #include "Mfx.h"
28 次查看(过去 30 天)
显示 更早的评论
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.
0 个评论
采纳的回答
Sandip Kumar
2014-10-6
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
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
2022-7-26
Changine the compiler from Autosar to the alternative (GNU) worked in version 2021b.
更多回答(1 个)
Chris Wiak
2016-8-16
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
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!