What does this error mean: "error: expected specifier-qualifier-list before" type_name? "?

I'm working on a Cell processor, and I'm trying to create a structure that will contain spe_context_ptr_t , which will be used in the thread to start the spe context, and will also contain a pointer to something else that will be passed to the spu context from the stream (currently I I'm trying to just make it a general pointer, but in fact it will be a pointer to another structure that I defined). When I try to compile, I get the following error:

 spu/../common.h:38: error: expected specifier-qualifier-list before 'spe_context_ptr_t' // here is the offending line(s) typedef struct _PTHREAD_BLOCK { spe_context_ptr_t * context; // Error happens here uintptr32_t args; } PTHREAD_BLOCK; 
+50
c ++ c pointers struct
Mar 03 '09 at 21:04
source share
8 answers

The compiler does not know that spe_context_ptr_t is a type. Make sure that the appropriate typedef is in scope when this code is compiled. You may have forgotten to include the corresponding header file.

+61
Mar 03 '09 at 21:07
source share

I had the same error message, but the solution is different.

The compiler parses the file from top to bottom.

Make sure the structure is defined before using it in another:

 typedef struct { char name[50]; wheel_t wheels[4]; //wrong, wheel_t is not defined yet } car_t; typedef struct { int weight; } wheel_t; 
+4
Dec 16 '09 at 15:14
source share

For iPhone projects cocoa -touch:

I had this problem and thanks to the comment of Eric Farraro I was able to solve this problem. I have imported the WSHelper.h class in many of my other classes. But I also imported some of the same classes into my WSHelper.h (circular, as Eric said). So, to fix this, I moved the import from my WSHelper.h file to the WSHelper.m file, since they are not needed at all in the .h file.

+2
Jun 17 2018-10-17
source share

You should name your structure as follows:

 typedef struct car_t { char wheel_t } car_t; 
0
Apr 08 '10 at 15:53
source share

I got it with an import path:

 ---FILE Bh #import "Ah" @interface B{ A *a; } @end ---FILE Ah #import "Bh" @interface A{ } @end 
0
Aug 20 '10 at 10:02
source share

I managed to figure out using the Gorgando fix, but instead of moving the import, I commented each one separately, built the application, and then edited it until I got rid of them.

0
Aug 28 2018-11-18T00:
source share

@simpleBob

 ---FILE Bh #import "Ah" @interface B{ A *a; } @end ---FILE Ah @class B; @interface A{ } @end 

The code above helped me figure it out. Can someone explain what is going on here?

0
Mar 30 '12 at 13:35
source share

this error mainly occurs when you use an object before using it.

-one
Sep 14 '15 at 6:53
source share



All Articles