Build error in juce_CoreAudio_mac.cpp

I tried building the AudioPluginHost today using JUCE 8.0.11 today and ran into a build error in juce_CoreAudio_mac.cpp like:

error: no type named 'value_type' in 'std::iterator_traits<juce::CoreAudioClasses::CoreAudioInternal::StrideIterator<const float *>>'

...

juce/modules/juce_audio_devices/native/juce_CoreAudio_mac.cpp:1125:18: note: in instantiation of function template specialization 'std::copy<juce::CoreAudioClasses::CoreAudioInternal::StrideIterator<const float *>, float *>' requested here
            std::copy (src, src + (ptrdiff_t) numSamplesInChunk, inStream->tempBuffers[(size_t) index]);

I could easyily silence that error by adding a specialization for std::iterator_traits to the end of the file like

 
namespace std 
{ 
    template <typename Iterator> 
    struct iterator_traits<juce::CoreAudioClasses::CoreAudioInternal::StrideIterator<Iterator>> : iterator_traits<Iterator> {}; 
} // namespace std 

But that was mainly to be able to continue working, there might be better fixes.

I’m was building on macOS 14.7.4 via CMake using AppleClang 15.0.0.15000100.

I’m surprised our CI hasn’t caught that. What args are you passing to the compiler?

I’m building it with CLion, using the default generated debug profile with the -DJUCE_BUILD_EXAMPLES=ON -DJUCE_BUILD_EXTRAS=ON CMake options added.

This results in a configure command like this

/Applications/CLion.app/Contents/bin/cmake/mac/aarch64/bin/cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_MAKE_PROGRAM=/Applications/CLion.app/Contents/bin/ninja/mac/aarch64/ninja -DJUCE_BUILD_EXAMPLES=ON -DJUCE_BUILD_EXTRAS=ON -G Ninja -S /Users/me/Projects/juce -B /Users/me/Projects/juce/build/debug

and a build command like this

/Applications/CLion.app/Contents/bin/cmake/mac/aarch64/bin/cmake --build /Users/me/Projects/juce/build/debug --target AudioPluginHost -j 9

So, nothing too fancy I guess.

Happy to help with more information that might be required to reproduce the issue on your end.

Could you please share the compiler invocation for the file that’s failing to build?

I’m not seeing an error on the versions of macOS and Xcode I have easily accessible, but I’ve not reproduced your setup exactly.

FWIW I’ve seen people complain about this error occasionally on the TAP discord. I always assumed it was an issue with trying to build JUCE 8 on an older version of MacOS or Xcode.

I can also confirm this was an issue when compiling a project on a machine running macOS Ventura with Xcode 15.2 and SDK version 14.2.

It appears to be specific to Xcode 15.2.