Currently the header files must be included in a specific order, otherwise the program crashes. This is caused by the following dependencies:
File A requires File B
File C requires File A
And the following #include statements in File C:
#include "B"
#include "A"
Where A and B do not include each other. If the order were reversed in file C:
#include "A"
#include "B"
The compilation would fail because the compiler must read file B before file A.
Solution
We need to move all include statements to where they are first needed. In the example above this means including file B in file A, then only including file A in file C.
Currently the header files must be included in a specific order, otherwise the program crashes. This is caused by the following dependencies:
A
requires FileB
C
requires FileA
And the following
#include
statements in File C:Where
A
andB
do not include each other. If the order were reversed in fileC
:The compilation would fail because the compiler must read file
B
before fileA
.Solution
We need to move all include statements to where they are first needed. In the example above this means including file
B
in fileA
, then only including fileA
in fileC
.