Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- a.h###################
- typedef struct a{
- ...
- }a_t;
- a.c###################
- #include "a.h"
- b.h###################
- typedef struct b{
- a_t* pointer_a;
- ....
- }b_t;
- b.c###################
- #include "a.h"
- #include "b.h"
- #########################################
- ...-> other stuff not relevant in this case
- this is part of a project which was working and which i'm refactoring
- i've used include guards in every a.h, b.h, etc.
- i just removed some unused functions from it up to now.
- i don't understand what the cause of the problem might be.
- whenever i try to compile i get the message:
- unknown type name 'a_t' for b.h
- however, in the project i've used the same technique in several places and
- the compiler doesn't seem to complain.
- i've used a_t* in the same exact way in other files (c.h, d.h, etc.)
- and i don't have any problem there.
- in b.c i include first a.h, then b.h, does the order matter?
- i never import a .h in another .h
- i extensively searched before asking.
- what am i doing wrong here?
- maybe circular import dependencies?
- maybe the compile order? does it matter?
- thank you
Advertisement
Add Comment
Please, Sign In to add comment