"fatal error C1083: Cannot open include file: 'rt_logging.h': No such file or directory"

18 visualizzazioni (ultimi 30 giorni)
I have built a model in simulink and i have generated c code using ert.tlc(system target file) and when I use mex command for that generated c code that is mex model.c in order to test the generated code for errors it is showing the following error " fatal error C1083: Cannot open include file: 'rt_logging.h': No such file or directory". Solution to this problem will be very helpful
  1 Commento
PJ
PJ il 2 Mar 2023
I'm getting a similar error when attempting to build in R2022b:
fatal error C1083: Cannot open include file: 'rtGetInf.h': No such file or directory
Did you find a resolution to this issue?

Accedi per commentare.

Risposte (1)

Manish
Manish il 11 Ott 2024
Modificato: Manish il 11 Ott 2024
Hi,
I understand that you are unable to locate the ‘rt_logging.h’.
Here are the simple steps you can follow to locate your ‘rt_logging.h’:
The "rt_logging.h" file is located in MATLAB's installation directory under `<matlabroot>/rtw/c/src`
To resolve the error, copy this file from the specified directory and paste it into your project folder.
To obtain all necessary "header files" during code generation, follow these steps:
  • Go to "Model Settings" in the "Modeling" tab on the taskbar.
  • Access the "Code Generation" section.
  • In the "Code Generation" area, under "Build Process," ensure that the "Generate Code Only" option is not selected.
  • Check the option labeled "Package code and artifacts."
  • Generate the code again
On following the above instructions, Simulink will create a zip file containing the code generation files and all required header files, which are stored in a separate folder.
Hope this helps!

Categorie

Scopri di più su Simulink Coder in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by