C++11 has been the default in Xcode for some time! I think since Xcode 5. You should definitely use it!
It's not that I don't want to, I really do! But it does not work...
Also, remember to #include <unordered_map>
dough! I didn't... But nevertheless, it says file not found. I checked it using find / grep in /Applications/XCode:
./Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/usr/include/c++/4.2.1/tr1/unordered_map
./Contents/Developer/Platforms/AppleTVSimulator.platform/Developer/SDKs/AppleTVSimulator.sdk/usr/include/c++/4.2.1/tr1/unordered_map
./Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/include/c++/4.2.1/tr1/unordered_map
./Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/include/c++/4.2.1/tr1/unordered_map
./Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/c++/4.2.1/tr1/unordered_map
./Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/unordered_map
But the compiler says:
CompileC /Users/daniel/Library/Developer/Xcode/DerivedData/AK-MonitorMatrix-hhwilcxkmjeajpasleuchvnubtjm/Build/Intermediates/AK-MonitorMatrix.build/Debug/AK-MonitorMatrix.build/Objects-normal/x86_64/PluginProcessor.o /Volumes/data/Developer/AK-MonitorMatrix/Source/PluginProcessor.cpp normal x86_64 c++ com.apple.compilers.llvm.clang.1_0.compiler
cd /Volumes/data/Developer/AK-MonitorMatrix/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++11 -Wno-trigraphs -fpascal-strings -O0 -Wno-missing-field-initializers -Wno-missing-prototypes -Wnon-virtual-dtor -Wno-overloaded-virtual -Wno-exit-time-destructors -Wno-missing-braces -Wparentheses -Wswitch -Wno-unused-function -Wno-unused-label -Wno-unused-parameter -Wunused-variable -Wunused-value -Wno-empty-body -Wno-uninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wno-constant-conversion -Wno-int-conversion -Wno-bool-conversion -Wno-enum-conversion -Wno-shorten-64-to-32 -Wno-newline-eof -Wno-c++11-extensions -D_DEBUG=1 -DDEBUG=1 -DJUCER_XCODE_MAC_F6D2F4CF=1 -DJUCE_APP_VERSION=1.0.0 -DJUCE_APP_VERSION_HEX=0x10000 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk -fasm-blocks -fstrict-aliasing -Wdeprecated-declarations -Winvalid-offsetof -mmacosx-version-min=10.8 -g -fvisibility-inlines-hidden -Wno-sign-conversion -iquote /Users/daniel/Library/Developer/Xcode/DerivedData/AK-MonitorMatrix-hhwilcxkmjeajpasleuchvnubtjm/Build/Intermediates/AK-MonitorMatrix.build/Debug/AK-MonitorMatrix.build/AK-MonitorMatrix-generated-files.hmap -I/Users/daniel/Library/Developer/Xcode/DerivedData/AK-MonitorMatrix-hhwilcxkmjeajpasleuchvnubtjm/Build/Intermediates/AK-MonitorMatrix.build/Debug/AK-MonitorMatrix.build/AK-MonitorMatrix-own-target-headers.hmap -I/Users/daniel/Library/Developer/Xcode/DerivedData/AK-MonitorMatrix-hhwilcxkmjeajpasleuchvnubtjm/Build/Intermediates/AK-MonitorMatrix.build/Debug/AK-MonitorMatrix.build/AK-MonitorMatrix-all-target-headers.hmap -iquote /Users/daniel/Library/Developer/Xcode/DerivedData/AK-MonitorMatrix-hhwilcxkmjeajpasleuchvnubtjm/Build/Intermediates/AK-MonitorMatrix.build/Debug/AK-MonitorMatrix.build/AK-MonitorMatrix-project-headers.hmap -I/Volumes/data/Developer/AK-MonitorMatrix/Builds/MacOSX/build/Debug/include -I/Volumes/data/Developer/SDK/VST3\ SDK -I../../JuceLibraryCode -I../../../JUCE-OSX/modules -I/Volumes/data/Developer/SDK/AAX_SDK -I/Volumes/data/Developer/SDK/AAX_SDK/Interfaces -I/Volumes/data/Developer/SDK/AAX_SDK/Interfaces/ACF -I/Users/daniel/Library/Developer/Xcode/DerivedData/AK-MonitorMatrix-hhwilcxkmjeajpasleuchvnubtjm/Build/Intermediates/AK-MonitorMatrix.build/Debug/AK-MonitorMatrix.build/DerivedSources/x86_64 -I/Users/daniel/Library/Developer/Xcode/DerivedData/AK-MonitorMatrix-hhwilcxkmjeajpasleuchvnubtjm/Build/Intermediates/AK-MonitorMatrix.build/Debug/AK-MonitorMatrix.build/DerivedSources -Wreorder -F/Volumes/data/Developer/AK-MonitorMatrix/Builds/MacOSX/build/Debug -MMD -MT dependencies -MF /Users/daniel/Library/Developer/Xcode/DerivedData/AK-MonitorMatrix-hhwilcxkmjeajpasleuchvnubtjm/Build/Intermediates/AK-MonitorMatrix.build/Debug/AK-MonitorMatrix.build/Objects-normal/x86_64/PluginProcessor.d --serialize-diagnostics /Users/daniel/Library/Developer/Xcode/DerivedData/AK-MonitorMatrix-hhwilcxkmjeajpasleuchvnubtjm/Build/Intermediates/AK-MonitorMatrix.build/Debug/AK-MonitorMatrix.build/Objects-normal/x86_64/PluginProcessor.dia -c /Volumes/data/Developer/AK-MonitorMatrix/Source/PluginProcessor.cpp -o /Users/daniel/Library/Developer/Xcode/DerivedData/AK-MonitorMatrix-hhwilcxkmjeajpasleuchvnubtjm/Build/Intermediates/AK-MonitorMatrix.build/Debug/AK-MonitorMatrix.build/Objects-normal/x86_64/PluginProcessor.o
/Volumes/data/Developer/AK-MonitorMatrix/Source/PluginProcessor.cpp:14:10: fatal error: 'unordered_map' file not found
#include <unordered_map>
^
1 error generated.
The root path of the includes is unfortunately not visible in the compiler call, so I don't know, if it's my fault or his...
Regarding the AudioProcessorValueTreeState, I get "unknown type". So I checked the source "juce_AudioProcessorValueTreeState.h" and see the preprocessor checking for JUCE_COMPILER_SUPPORTS_LAMBDAS and it seems to be unset. Then I override it via introjucer - extra preprocessor definitions "JUCE_COMPILER_SUPPORTS_LAMBDAS=1" and then I get
In file included from /Volumes/data/Developer/AK-MonitorMatrix/Source/PluginEditor.cpp:11:
In file included from /Volumes/data/Developer/AK-MonitorMatrix/Source/PluginProcessor.h:14:
In file included from /Volumes/data/Developer/AK-MonitorMatrix/Source/../JuceLibraryCode/JuceHeader.h:18:
In file included from ../../JuceLibraryCode/modules/juce_audio_devices/juce_audio_devices.h:4:
In file included from ../../JuceLibraryCode/modules/juce_audio_devices/../../../../JUCE-OSX/modules/juce_audio_devices/juce_audio_devices.h:28:
In file included from ../../JuceLibraryCode/modules/juce_audio_devices/../../../../JUCE-OSX/modules/juce_audio_devices/../juce_events/juce_events.h:34:
../../JuceLibraryCode/modules/juce_audio_devices/../../../../JUCE-OSX/modules/juce_audio_devices/../juce_events/messages/juce_MessageManager.h:97:33: error: no type named 'function' in namespace 'std'
static void callAsync (std::function<void(void)>);
~~~~~^
...not a big surprise, the compiler told me that he has no lambdas, if I start messing with defines...
And that's all happening in a fresh project with in introjucer and checken XCode, C++11 is set correctly (N.B. OSW 10.10, XCode 7.2)...
I just tried it creating a new project in the Introjucer with the default settings: C++11 and std::unordered_map work like a charm.
I envy you ;-)
It's "killing me slowly"...