Why do I get an error message when loading a dll generated from a continuous Simulink model with the Embedded Coder 6.4 (R2013a)?

I want to deploy a MATLAB application that interacts with a continuous Simulink model.
First, I generate a dll from the Simulink model using the Embedded Coder and the ert_shrlib.tlc target file. Then I intend to load this dll in MATLAB using LOADLIBRARY.
However, when I try to load the dll generated from this continuous model, I receive the following error:
??? Error using ==> loadlibrary
Failed to preprocess the input file.
fatal error C1083: Cannot open include file: 'rtw_continuous.h': No such file or directory

 채택된 답변

When generating code from a model with a continuous solver, an aditionnal dependency to rtw_continuous.h is added.
This header file is contained in the MATLAB installation folder matlabroot\simulink\include.
In order to properly load the generated library, you need to add the appropriate include path when using LOADLIBRARY as follows:
loadlibrary('model_win64.dll','./model_ert_shrlib_rtw/model.h',...
'includepath','./model_ert_shrlib_rtw' ,...
'includepath',fullfile(matlabroot,'simulink','include'));

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Deployment, Integration, and Supported Hardware에 대해 자세히 알아보기

태그

아직 태그를 입력하지 않았습니다.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by