Hello

Im trying to compile the following code but I get the error "left operand has incompatible type" because of the line:

test2_2_U->Out2= test2_2_U->Out3;

I have been looking through the forum but I couldnt find a hint what Im doing wrong. Any hint is appreciated.

Thanks Thomas

static BlockIO_test2_2 test2_2_B;      /* Observable signals */
static D_Work_test2_2 test2_2_DWork;   /* Observable states */
static ExternalInputs_test2_2 test2_2_U;/* External inputs */
static ExternalOutputs_test2_2 test2_2_Y;/* External outputs */

void rt_OneStep(RT_MODEL_test2_2 *test2_2_M)
{
 
 test2_2_step(&test2_2_B, &test2_2_DWork, &test2_2_U, &test2_2_Y);
 test2_2_Y->Out2=  test2_2_Y->Out3;

}

where test2_2_U is defined as:

66   typedef struct {
   67     real_T Out1_f;                       /* '<Root>/Out1' */
   68     real_T Out2;                         /* '<Root>/Out2' */
   69     real_T Out3;                         /* '<Root>/Out3' */
   70     real_T Out4;                         /* '<Root>/Out4' */
   71   } ExternalOutputs_test2_2;
   72

Recommended Answers

Is test2_2_U a pointer?

Jump to Post

Okay. That one too.
Is the thing on the left side of the-> operator a pointer?

Jump to Post

All 5 Replies

Is test2_2_U a pointer?

its defined as:

test2_2_Y->Out2 = 0.0;
  test2_2_Y->Out3 = 0.0;

Okay. That one too.
Is the thing on the left side of the-> operator a pointer?

You misunderstand. It's -- static ExternalInputs_test2_2 test2_2_U; For non-pointers you use the . operator. Not ->. Try replacing -> with .

You misunderstand. It's -- static ExternalInputs_test2_2 test2_2_U; For non-pointers you use the . operator. Not ->. Try replacing -> with .

Thanks so much! That helped

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.19 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.