MATLAB: Do I get an error message when loading a dll generated from a continuous Simulink model with the Embedded Coder 6.4 (R2013a)

Embedded Coder

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

Best Answer

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'));