Sharing code between projects

Is there a reason the juce header is specified as #include "../JuceLibraryCode/JuceHeader.h" rather than:

#include "JuceHeader.h"

And then setting a path to the jucelibraryfiles folder …I need to move to using a search path for some code that’s shared between two different related JUCE projects…

I can’t see there’s a problem, but then I can’t see why it was done with the relative path to start with … except to twist the minds of people who like to use lots of subfolders…

3 Likes

I have this kind of code sharing between projects so always change the include to just "JuceHeader.h" since Projucer-generated projects set JuceLibraryCode as a search path in the IDE projects anyway.

BTW the Projucer also puts #include "../JuceLibraryCode/JuceHeader.h" in both the .h and .cpp files when adding files to a project. I always just remove it from the .cpp file.

3 Likes

it would be super cute if it was just

#include "juce.h"

I have lzy fngrs.

3 Likes