how to fix cyclic include of header files?
hello, i have 2 classes (the character class, and another class) which both depend on each other and i have functions which get each other in the parameters so i require to include the class in the character.h and in the class.h i need the character.h. but i cannot compile because of the cyclic include loop that was created. how can i fix it?
The standard solution is to make sure that headers are properly #if guarded, and then to use forward declarations.
Note that it is impossible to make both "doSomethingWithA()" and "doSomethingWithB()" be inline defined.
answered Jul 11 '14 at 05:33 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here