JUCE is busted in Xcode 11.4

I don’t think it’s ever been disabled.

I just tried doing a default audio plugin project on mac os x and there isn’t a switch to disable it in ProJucer. Adding “DONT_SET_USING_JUCE_NAMESPACE=1” to the preprocessor macros does disable the using namespace juce;, but then the project won’t build anymore as it can’t find many types. The library code itself seems fine, but the template project definitely can’t handle it.

that was it - i do have a custom StandaloneFilterWindow, i updated it with the changes from 3520f6c4f6dece4eb7b09ed80c021f064b3563f7 and it works now, sorry for the noise.

Is this fix backwards compatible? If I update JUCE to develop, what’s the oldest Xcode that will still build it?

Building should (still) be supported on macOS 10.11 and Xcode 7.3.1.

2 Likes

On a side note, “Rectangle” has been an ambiguous clash with “Windows.h” since I’ve been using Juce, 2 years or so ago.

Is the clash in JUCE itself? If not, what I said earlier applies here: There’s not much JUCE can to do to prevent ambiguities between juce::Rectangle and global Rectangle if windows.h is included in user code (JUCE is already doing the right thing by namespacing Rectangle). Commonly-used identifiers like ‘Point’ and ‘Rectangle’ should never be declared in the global namespace for exactly this reason.

On a side note, “Rectangle” has been an ambiguous clash with “Windows.h” since I’ve been using Juce, 2 years or so ago.

You can also use #define NOGDI before you include Windows.h to get rid of Rectangle if you don’t need he GDI stuff.

3 Likes

Hi! Any info on how to fix this problem? Seems to occur only since upgrading xcode to 11.4. I’m still confused after reading through this thread. Cheers!

Edit 1

What does this mean?

Make sure you’re using an up-to-date version of JUCE, ideally the current state of the develop branch. I think that master currently won’t build with Xcode 11.4.

Thanks for the reply. I forgot to mention that I did all that.

Is the issue in your code, or in the JUCE source? Are you including any apple framework headers directly, or are you relying entirely on JuceHeader.h?

Downgraded to xcode 11.3.1 and everything works fine.

The issue with 11.4 seems to be in the JUCE source:

project/JuceLibraryCode/include_juce_audio_plugin_client_AU_1.mm:9:10: In file included from project/JuceLibraryCode/include_juce_audio_plugin_client_AU_1.mm:9:

project/JUCE_WASM/modules/juce_audio_plugin_client/juce_audio_plugin_client_AU_1.mm:27:10: In file included from ../../JUCE_WASM/modules/juce_audio_plugin_client/juce_audio_plugin_client_AU_1.mm:27:

Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/CoreAudioTypes.framework/Headers/CoreAudioBaseTypes.h:147:29: Candidate found by name lookup is 'AudioBuffer'

project/JUCE_WASM/modules/juce_audio_basics/buffers/juce_AudioSampleBuffer.h:33:7: Candidate found by name lookup is 'juce::AudioBuffer'

What would an apple framework header look like? I have not really done any C or C++, so I’m not sure where to look. In most of my source files, I’m either referencing my other source files, JuceHeader.h or some native libs.

JuceHeader.h includes are:

#include "../../JuceLibraryCode/JuceHeader.h"
#include "JuceHeader.h"

Other includes are:

#include <memory>
#include <math.h>

Let me know if you need more info.

Thanks.

Thanks for the extra info. Can you paste the very beginning of that error, so that I can see on which file/line the problem is happening?

Also, did you definitely resave your project in the Projucer after updating your JUCE version to develop?

Oh yeah sorry about that. project/JUCE_WASM/modules/juce_audio_plugin_client/AU/juce_AU_Wrapper.mm:1802:24: Reference to 'AudioBuffer' is ambiguous

So yes, I saved the project by clicking on the XCode “Save and open in IDE” icon in Projucer. Just to be sure, I’m using Projucer version 5.4.7 with Build date of 1 April 2020.

On develop, line 1802 of that file is a closing curly brace.
However, there was a reference to AudioBuffer on line 1802 a few months ago. Can you double check that your copy of juce is up-to-date, as I think that’s the most likely cause of the problem.

Brand new user here. Yesterday I updated my OS, installed Xcode and JUCE.

I see this thread is now a month old, and yet the latest JUCE binary (5.4.7) is still throwing this error. I don’t imagine I can downgrade from Xcode 11.4 to 11.3, given my MacOS is so new (10.15.4); Xcode 11.3.1 only supported up to Catalina 10.15.2.

How does one get the “develop branch” – is there a “nightly build” binary for this, or do I have to build JUCE from source?

It looks like the fix pointed to by @reuk just amounts to prepending “juce::” to the offending “AudioBuffer” declarations.
Yea! Actually, just doing that to my existing files fixed this error, and my build works. :slight_smile:

A note on how to run on develop like n00bs like me:

On MacOS, the JUCE libraries are expected to be at ~/JUCE, otherwise you can change them via Projucer > Global Paths

If you originally downloaded JUCE, you’ll have to clone the repo and switch to develop:

git clone https://github.com/juce-framework/JUCE.git
cd JUCE
git checkout develop

Don’t be tricked by the modules saying they are still 5.4.7 in the Projucer — JUCE 6 isn’t out yet :slight_smile:

If you want to confirm you are on develop, you can open up one of the modules and make sure the comment header says 2020 Raw Material (and not 2017 ROLI).

I’m not sure how often people bother building the Projucer, how often, whether they have an alias from Applications to JUCE/extras/Projucer/Builds/MacOSX/build/Debug/ etc…

1 Like

Unfortunately there is still a problem with JUCE and Xcode 11.4.1, if you try to build a VST3 on the Mac, even with the Developer branch.

There is code in the bundleEntry() function in juce_VST3_Wrapper.cpp that uses CFBundleRef and CFURLRef objects. These are no longer defined anywhere, probably because CoreFoundation.h was removed from juce_TargetPlatform.h in order to fix the Xcode 11.4 incompatibility.

We’re dead in the water with our project at the moment because we can’t build the VST3 version. Hopefully this is easily remedied!

Dan

Are you seeing this with a default JUCE plug-in project? I’m using Xcode 11.4.1 on macOS 10.15.4 and the AudioPluginDemo builds without issue on the develop branch.

Sorry, I haven’t tried that. But I discovered I can get around the issue by putting #include <CoreFoundation/CoreFoundation.h> back in juce_TargetPlatform.h, effectively undoing this change to juce_TargetPlatform.h:

I hope that helps.

Dan

1 Like