Why is the 'rtlibsrc.h' file not included in the current path of the generated code in Real-Time Workshop Embedded Coder?

2 views (last 30 days)
The generated code for my model contains the following line:
#include "rtlibsrc.h"
However, this file is not located in the same path as the generated code. When I compile the code outside of Real-Time Workshop Embedded Coder, I need to copy the file every time. I would like this file to be placed in the same path as the generated code.

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 27 Jun 2009
The ability to automatically include the 'rtlibsrc.h' header file in the same path as the generated code is not available in Real-Time Workshop Embedded Coder.
To workaround this issue from R2006b onwards, please use the command 'packNGo' to pack all the generated files. Using this command will automatically pick the file 'rtlibsrc.h'.
For previous product releases, read below for any possible workarounds:
To work around this issue, manually copy $MATLABROOT\rtw\c\libsrc\rtlibsrc.h file to the same directory as the generated code, where $MATLABROOT is the MATLAB installation directory on your machine which can be obtained by typing
matlabroot
at the MATLAB Command prompt.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!