cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

Peterp
Journeyman III

Problem with struct and #include

Hello,

i have a probem with a self defined datatype, i have my headerfile type.h

with this def.

struct my_float8
{
   float4 nibble1;
   float4 nibble2;
};

And i want to use it in my br-file like this:

#include "type.h"

void funk(int length, float *daten)
{
     my_float8 mf8;
 }

But i always get this compile error:

Error (parse error) before 'Identifier' my_float8 mf8;

0 Likes
4 Replies
gaurav_garg
Adept I

Hi Peterp,

To use a structure brcc requires its definition to be present in the br file. Brcc generates multiple buffers with the types defined in structure.

Brcc doesn't have support to parse #include directive, hence it doesn't find the definition and you see this error.

 

0 Likes

Originally posted by: gaurav.garg Hi Peterp,

To use a structure brcc requires its definition to be present in the br file. Brcc generates multiple buffers with the types defined in structure.

Brcc doesn't have support to parse #include directive, hence it doesn't find the definition and you see this error.

Hi,

if i write the def. into the br-file like this :

void transpose_brook(int length, float *daten)
{
    struct my_float8
    {
      float4 nibble1;
      float4 nibble2;
    };
 my_float8 mf8<10>;
}

i get the same error.

0 Likes

PeterP,

Brook is derived from C, so it has to be -

typedef struct my_float8_def

{
      float4 nibble1;
      float4 nibble2;
  } my_float8;

void transpose_brook(int length, float *daten)
{
     my_float8 mf8<10>;
}

0 Likes

Originally posted by: gaurav.garg PeterP,

Brook is derived from C, so it has to be -

typedef struct my_float8_def

{       float4 nibble1;       float4 nibble2;   } my_float8;

void transpose_brook(int length, float *daten) {      my_float8 mf8<10>; }

Thank you very much. Now it works.

0 Likes