#error "No global header file was included!" doesn't magically go away after I re-save my project with the Projucer

Hi all,
it’s probably stupid, but I’m stucked with an error that says “No global header file was included!” after I took an old project and tried to resuscitate it.
I did just like the doc says and re-saved my project with the projucer, but the error is still there.
I have to admit I have no idea why it appeared and how to fix it.

I know I can set JUCE_GLOBAL_MODULE_SETTINGS_INCLUDED to 1, but it sounds like cheating and I would like to understand and do a proper fix.


EDIT: I just find out that the JUCE_GLOBAL_MODULE_SETTINGS_INCLUDED is already set to one in a file called AppConfig.h. Now I’m lost for real…

Hi @alpereira7,

I guess you get that error because some of your source files are directly including some JUCE module headers, such as juce_core.h or juce_graphics.h (which transitively include juce_TargetPlatform.h).

JUCE_GLOBAL_MODULE_SETTINGS_INCLUDED is indeed set to 1 in AppConfig.h. JuceHeader.h includes AppConfig.h right before including juce_core.h and the other JUCE module headers. This ensures that the settings defined in AppConfig.h apply to all JUCE code in your project.

In your source files you should only include JuceHeader.h. That way everything will be properly configured and you shouldn’t get that error anymore.

I hope this helps.

1 Like