FMUをクロスコンパイルするとエラーが発生するのはなぜですか?
조회 수: 2 (최근 30일)
이전 댓글 표시
MathWorks Support Team
2025년 9월 1일 0:00
답변: MathWorks Support Team
2025년 9월 1일 6:09
FMUをクロスコンパイルするために、次のクロスコンパイルページを試しました。
https://jp.mathworks.com/help/releases/R2022b/slcompiler/gs/export-model-to-standalone-fmu-with-source-code.html
しかし、実際に単純なGainのみのモデルでこれを行ったところ、fmi2Functions.hが欠落しているなどのコンパイルエラーが発生しました。
(エラーメッセージ)
simpleGain_fmu.c:42:10:fatal error: fmi2Functions.h: そのようなファイルまたはディレクトリはありません
42 | #incluse "fmi2Functions.h"
| ^~~~~~~~~~
compilation terminated.
このエラーを解決するにはどうすればいいですか?
채택된 답변
MathWorks Support Team
2025년 9월 1일 0:00
このエラーは、FMI標準ヘッダーファイルの1つであるfmi2Function.hがソースコードのコンパイル中に欠落していることを意味します。
fmi2Function.h がないのは、FMI v2.0 標準で次のように述べられているように、Simulink FMU Export で想定される動作です。
(2.3 FMU Distribution)
sources
// Optional directory containing all C sources
// all needed C sources and C header files to compile and link the FMU
// with exception of: fmi2TypesPlatform.h , fmi2FunctionTypes.h and fmi2Functions.h
FMUソースコードをコンパイルするために、fmi2TypesPlatform.h、fmi2FunctionTypes.h、およびfmi2Functions.hのコピーを入手が必要です。
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 FMU インポート에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!