Why does Accelerator Mode not include file(s) provided in the custom code configurations?

6 visualizaciones (últimos 30 días)
I have a model which includes an S-function block that requires certain libraries. This libraries are included in the "Code Generation > Custom Code" section. The model is not able to link the associated files when running in accelerator mode, but works fine in rapid accelerator mode. I see an error such as:
====================== Error below ======================
fatal error C1083: Cannot open include file: 'myHeader.h': No such file or directory

Respuesta aceptada

MathWorks Support Team
MathWorks Support Team el 26 de Mayo de 2020
Editada: MathWorks Support Team el 26 de Mayo de 2020
We have identified two ways of having your required files linked while running in accelerator mode. I have listed these below:
1. Manually edit the makeInfo.includePath and makeInfo.sources section of the file "libs\timesn\rtwmakecfg.m" to reflect the following:
makeInfo.includePath = {pwd};
makeInfo.sources = {'filename1', 'filename2'};
Note: if you have a custom S-function created without the S-function builder, you may need to create the rtwmakecfg.m manually and put it in the same directory as the S-function itself. To have an additional include directory, the function would look like:
function makeInfo = rtwmakecfg()
makeInfo.Name = 'MyCustomConfig';
makeInfo.includePath = {'YOUR_PATH_NAME'};
end
2. Build the S-Function using S-Function builder block and under the libraries pane, include the following:
...\filename1
...\filename2
Note: include the full path to the source files
Note: define the input and output data types under the data properties pane

Más respuestas (0)

Categorías

Más información sobre Simulink Environment Customization en Help Center y File Exchange.

Productos


Versión

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by