Projucer enables "Add using namespace juce to JuceHeader.h" when it opens PIP

When I make new project from “File”->“New Project”, “Add using…” is disabled.
But I do it from “File”->“open…” and choose PIP file, it was enabled.
Is this what JUCE intend to? Or a bug?

Yes, this is deliberate. The current behaviour in the Projucer is to keep the namespace enabled for ‘old’ (before the new namespace behaviour was introduced) non-PIP projects, but to disable it for new non-PIP projects. Unfortunately there’s no way to identify the JUCE/Projucer version that was used to create a particular PIP, so we keep the namespace enabled for backwards compatibility with existing PIPs.

This might change at some point in the future, once people have had some time to get used to the new default using namespace behaviour. In the meantime, you can force PIPs to disable the using namespace juce line by adding DONT_SET_USING_JUCE_NAMESPACE=1 to the moduleFlags: field of the PIP metadata block.

1 Like

DONT_SET_USING_JUCE_NAMESPACE=1 not to the moduleFlags: field but to the defines: field works fine for me.