XCode Error with dsp Syntax

Since it compiles fine with VS2017, then something must be wrong in the arguments passed to clang. Could you copy-paste the complete command line? Here is an example that I found on Google Image:

Here is the the listing of the arguments. Note that I do not modify what is produced by Projucer. So, this is what Projucer fed to Xcode.

    cd /Users/billwall/SDKs/AAXProjects/Dip/Builds/MacOSX
    export LANG=en_US.US-ASCII
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x c++ -arch x86_64 -fmessage-length=0 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit=0 -std=c++14 -Wno-trigraphs -fpascal-strings -O3 -fno-common -Wno-missing-field-initializers -Wno-missing-prototypes -Wunreachable-code -Wnon-virtual-dtor -Wno-overloaded-virtual -Wno-exit-time-destructors -Wno-missing-braces -Wparentheses -Wswitch -Wunused-function -Wno-unused-label -Wno-unused-parameter -Wunused-variable -Wunused-value -Wempty-body -Wuninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wconstant-conversion -Wint-conversion -Wbool-conversion -Wenum-conversion -Wno-float-conversion -Wnon-literal-null-conversion -Wobjc-literal-conversion -Wshorten-64-to-32 -Wno-newline-eof -Wno-c++11-extensions -D_NDEBUG=1 -DNDEBUG=1 -DJUCER_XCODE_MAC_F6D2F4CF=1 -DJUCE_APP_VERSION=1.1.1 -DJUCE_APP_VERSION_HEX=0x10101 -DJucePlugin_Build_VST=1 -DJucePlugin_Build_VST3=1 -DJucePlugin_Build_AU=1 -DJucePlugin_Build_AUv3=0 -DJucePlugin_Build_RTAS=0 -DJucePlugin_Build_AAX=1 -DJucePlugin_Build_Standalone=0 -DJUCE_SHARED_CODE=1 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk -fasm-blocks -fstrict-aliasing -Wdeprecated-declarations -Winvalid-offsetof -mmacosx-version-min=10.9 -fvisibility=hidden -fvisibility-inlines-hidden -Wno-sign-conversion -Winfinite-recursion -Wmove -Wcomma -Wblock-capture-autoreleasing -Wstrict-prototypes -Wrange-loop-analysis -I/Users/billwall/SDKs/AAXProjects/Dip/Builds/MacOSX/build/Release/include -I/Users/billwall/SDKs/VST_SDK/VST3_SDK -I../../JuceLibraryCode -I/Users/billwall/SDKs/AAX_SDK_2p3p1 -I/Users/billwall/SDKs/AAX_SDK_2p3p1/Interfaces -I/Users/billwall/SDKs/AAX_SDK_2p3p1/Interfaces/ACF -I../../../../JUCE-OSX/modules -I../../../../JUCE-OSX/modules/juce_audio_plugin_client -I/Users/billwall/Library/Developer/Xcode/DerivedData/Dip-ahrudztqbpohjzgohczkrdxqomdx/Build/Intermediates.noindex/Dip.build/Release/Dip\ -\ Shared\ Code.build/DerivedSources/x86_64 -I/Users/billwall/Library/Developer/Xcode/DerivedData/Dip-ahrudztqbpohjzgohczkrdxqomdx/Build/Intermediates.noindex/Dip.build/Release/Dip\ -\ Shared\ Code.build/DerivedSources -Wreorder -F/Users/billwall/SDKs/AAXProjects/Dip/Builds/MacOSX/build/Release -MMD -MT dependencies -MF /Users/billwall/Library/Developer/Xcode/DerivedData/Dip-ahrudztqbpohjzgohczkrdxqomdx/Build/Intermediates.noindex/Dip.build/Release/Dip\ -\ Shared\ Code.build/Objects-normal/x86_64/PluginProcessor.d --serialize-diagnostics /Users/billwall/Library/Developer/Xcode/DerivedData/Dip-ahrudztqbpohjzgohczkrdxqomdx/Build/Intermediates.noindex/Dip.build/Release/Dip\ -\ Shared\ Code.build/Objects-normal/x86_64/PluginProcessor.dia -c /Users/billwall/SDKs/AAXProjects/Dip/Source/PluginProcessor.cpp -o /Users/billwall/Library/Developer/Xcode/DerivedData/Dip-ahrudztqbpohjzgohczkrdxqomdx/Build/Intermediates.noindex/Dip.build/Release/Dip\ -\ Shared\ Code.build/Objects-normal/x86_64/PluginProcessor.o

Have you tried this syntax?

chain.template get<0>()

1 Like

Thank you! Your suggested syntax works in Xcode as well as Visual Studio 2017.

I truly appreciate your help! I was stuck and unable to move forward with that single issue in Xcode.

Others using the dsp class, and the ProcessorChain functionality should take note;

For a given ProcessorChain chain;

chain.get<0>() syntax works in VS2017, but not in Xcode.

chain.template get<0>() syntax works in Xcode and VS2017.

I do not know if an alternative syntax is possible in this scenario, but this syntax in the dsp class is very unintuitive.

Can we get a comment in the dsp class that explains how to use this syntax?

Forgive me for sounding old fashioned, but am I the only one that finds the design of the DSP module obtuse? This syntax stuff alone saddens me.

To which I would add----in a library module, such as dsp, shouldn’t the syntax have been tested in all environments?

And, again, I think we need commenting in the dsp class to explain how everything works, especially odd uses of syntax as we have discussed here.

…don’t get me wrong…the dsp class has lots of good features too, and will certainly teach us a lot about templates!

I think it needs a little bit of a re-think to bring it in-line with how we are used to seeing things. In other words, just a smoothing or rough edges, rather than a complete re-do.

i figured out what’s going on here (in xcode anyway) - this works:

ProcessorChain<Gain<float>> chain;
chain.get<0>();

but if you’re using a templated class you have to use the .template syntax:

template T
...
ProcessorChain<Gain<T>> chain;
chain.get<0>();  // gives "Missing 'template' keyword prior to dependent template name 'get'" on xcode 11.3.1
chain.template get<0>(); // this works!

hope this helps someone - seems like xcode gives a much more useful error than it used to when i first ran into this.