You gave the example of the relay actuator for the function but I took the esp8266 gateway to start with.
What I mean is that you see "in the top" the spi.h and eeprom.h declarations.
Then a number of #define statements.
And just above the void setup()the MySensors.h and esp8266wifi.h are declared.
I had some definitions that required the MySensors.h and those gave errors because they were declared below the "normal" position of the includes but above the "MySensors.h". (I even considered filing a bug ticket for the missing MySensors.h )
So I declared the MySensors.h in the top of the ino below spi.h and eeprom.h (because I had not seen the MySenors.h almost at the bottom of the ino).
And then some errors were fixed and a few other arose. It took me quite some time to see that the MySensors.h was declared sooo low in the ino where I definitely had not expected it.