[ACCEPTED]-What does this error mean: "error: expected specifier-qualifier-list before 'type_name'"?-struct
The compiler doesn't know that spe_context_ptr_t 4 is a type. Check that the appropriate typedef 3 is in scope when this code is compiled. You 2 may have forgotten to include the appropriate 1 header file.
I had the same error message but the solution 3 is different.
The compiler parses the file 2 from top to bottom.
Make sure a struct is 1 defined BEFORE using it into 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;
For iPhone cocoa-touch projects:
I had this 9 problem and thanks to Eric Farraro's comment, I 8 was able to get it resolved. I was importing 7 a class WSHelper.h in many of my other classes. But 6 I also was importing some of those same 5 classes in my WSHelper.h (circular like 4 Eric said). So, to fix this I moved the 3 imports from my WSHelper.h file to my WSHelper.m 2 file as they weren't really needed in the 1 .h file anyway.
You have to name your struct like that:
typedef struct car_t {
char
wheel_t
} car_t;
0
I got it with an import loop:
---FILE B.h
#import "A.h"
@interface B{
A *a;
}
@end
---FILE A.h
#import "B.h"
@interface A{
}
@end
0
I was able to sort this out using Gorgando's 4 fix, but instead of moving imports away, I 3 commented each out individually, built the 2 app, then edited accordingly until I got 1 rid of them.
More Related questions
We use cookies to improve the performance of the site. By staying on our site, you agree to the terms of use of cookies.