JuceHeader.h problems with user module and client app

Hello there!

I have a project app gui in juce that I want to turn into a module in order to create another console app for testing from which we would import the module to run the tests.

The module uses the same Source files as the gui app, but those files need the JuceHeader.h in order to be run in gui app mode, but, apparently, it needn’t to be there for the module. I mean, when I put those JuceHeader.h, the gui app works but the console app (using the module) doesn’t, and when I remove the JuceHeader.h’s, the console app works and the gui app doesn’t. There are some .h that have juce inheritance and need the JuceHeader.h, but a forward declaration is not possible and including it will make the module to stop working.

Hopefully you can shed some light on the matter. Thanks in advance!

JuceHeader.h is a shortcut to include the headers of all modules added to the projucer project and is generated indivindually on a per-project base. As a module is project independent, it doesn‘t know JuceHeader.h.

If your module depends on functionality from other modules, include the Module Headers directly like #include <juce_core/juce_core.h>. Don’t forget to add the dependecy in the module description of your own module!

1 Like

Thank you very much for your answer! I’ll try to follow that process and see if everything works altogether, will let you know when finished.

Thanks again!