Why can my header file not be found during the build process for my Simulink model?
53 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
MathWorks Support Team
el 15 de Jun. de 2020
Editada: MathWorks Support Team
el 19 de Feb. de 2024
Trying to build my Simulink model, I get any of the following errors, depending on the compiler being used
fatal error C1083: Cannot open include file: 'myFile.h': No such file or directory
fatal error #1965: cannot open source file 'myFile.h'
The file is on the MATLAB path, why can it not be found?
Respuesta aceptada
MathWorks Support Team
el 19 de Feb. de 2024
Editada: MathWorks Support Team
el 19 de Feb. de 2024
Simulink will pass the current folder as well as any specified include directories path(s) to the build process. If the header file is in neither of these locations, the error above will be thrown by the compiler. Note that the MATLAB search path has no impact on the directories included in the build process.
Check to make sure that the path to the header file is defined in this location:
Simulink Model Settings > Code Generation > Custom Code > Include Directories
Refer to the link below for things to consider when adding paths to the include directories list:
If the header file is related to an S-function, a more advanced, but also more elegant approach to manage your S-function dependencies would be to write a "makecfg.m" file. Through this file, you can specify all dependencies and includes for the S-function. This is particularly recommended if you aim to distribute the S-functions to other users:
0 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Simulink Coder en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!