Conflict bewteen rtwtypes and tmwtypes

41 views (last 30 days)
Felipe Herrera
Felipe Herrera on 3 Dec 2024 at 17:59
Commented: Felipe Herrera on 4 Dec 2024 at 18:45
I'm testing the embedded coder app in Simulink. I have generated C code for a simple adder which takes two numbers and add them. I succesfully generated the C code for this simulink model, and now I'm trying to make it work in the S-function builder. When I build the code, the following errors appears:
line 1: rtwtypes.h:77:16: error: conflicting types for 'byte_T' typedef char_T byte_T;
line 2: tmwtypes.h:580:16: note: previous declaration of 'byte_T' was here typedef BYTE_T byte_T;
I understand that "byte_T" is being defined in two different header files. However, I don't know how to avoid this. The answer given in this question suggest to include the following lines of code:
#if defined(MATLAB_MEX_FILE)
#include "tmwtypes.h"
#include "simstruc_types.h"
#else
#include "rtwtypes.h"
#endif
However, this lines of code are already included in the wrapper generated by the S-function builder. How could I avoid this clash between rtwtypes.h and tmwtypes.h?
  1 Comment
Felipe Herrera
Felipe Herrera on 4 Dec 2024 at 18:45
I found a workaround this problem. Basically, I commented the lines of the code in rtwtypes.h which were producing the problem. Personally, I don't like this solution too much as I would prefer something more automatized. However, I leave this here in case someone else face the same problem.

Sign in to comment.

Answers (0)

Categories

Find more on Simulink Coder in Help Center and File Exchange

Products


Release

R2024b

Community Treasure Hunt

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

Start Hunting!