Invictus
Invictus

Reputation: 2780

error: expected specifier-qualifier-list before

I am getting this following error,

I have a "A.c" file in which I have included a "b.h" file, which has a "c.h" file. Now this c.h has structures which are getting used and they are all int. the structures are used in the following way:

In "c.h" file

struct abc{

int a;<---- error

};

In "b.h"

struct def{

struct abc;

};

and I have used struct def in file "A.c" file. Please, help me know what wrong have I done.

Upvotes: 0

Views: 906

Answers (1)

unwind
unwind

Reputation: 399833

You probably have some nesting error, a missing ; or something that confuses the compiler.

I would recommend trying to get hold of the preprocessor output, so you can see what the compiler sees, once the #includes have been executed.

Upvotes: 1

Related Questions