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 (최근 30일)
이전 댓글 표시
MathWorks Support Team
2018년 5월 21일
편집: MathWorks Support Team
대략 11시간 전
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?
채택된 답변
MathWorks Support Team
대략 16시간 전
편집: MathWorks Support Team
대략 1시간 전
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
추가 답변 (0개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!