Why are some header files such as "ippreconstruct.h" and "tmwtypes.h" not generated even though they are included with "#include" in source code generated with MATLAB Coder?
12 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
MathWorks Support Team
el 21 de Mayo de 2018
Editada: MathWorks Support Team
hace alrededor de 13 horas
When I generate code from my MATLAB function using MATLAB Coder, I observe that some files are included in the source code (.C code) using the #include tag, but that these files are not generated as part of the code generation.
For example, files are included as follows:
#include "ippreconstruct.h"
#include "tmwtypes.h"
The above header files, although included in the .C files, are not generated. As a result, when I am using the generated code to compile them in some other application (e.g., Visual Studio), I get the error that these header files are missing.
However, I can observe that some of the other MATLAB specific header files like "rtwtypes.h" do get generated along with the other source code. Why are these files not included?
Respuesta aceptada
MathWorks Support Team
hace alrededor de 15 horas
Editada: MathWorks Support Team
hace 35 minutos
The header files are missing from the generated files because all files which are a part of MATLAB installation (present in the ‘MATLABROOT\extern\include’ directory) do not get copied into the generated code.
Since these files are already available in the MATLAB directory, it is expected that to compile these files it will be possible to simply include the path of these files in the ‘include’ directory of the external compiler.
In contrast, other MATLAB files such as "rtwtypes.h" are generated because these files are not available in the MATLAB installation directory. These files are customized to the specific project for which code is generated and are not generic files.
To generate all included files when generating code, the "packNGo" option can be used, which will create a ZIP folder with all the files included. This option can be used if the generated code needs to be relocated to another development environment. For details, please see documentation on how to Package Code for Other Development Environments.
In addition, the necessary files to include in the external compiler may be found in the MK file, if the MATLAB Coder is configured to generate one.
0 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre MATLAB 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!