In file included from …/…/…/JUCE/modules/juce_core/juce_core.cpp:108:
…/…/…/JUCE/modules/juce_core/maths/juce_Expression.cpp:47:16: error: no viable conversion from ‘std::__1::nullptr_t’ to 'ReferenceCountedObjectPtrjuce::Expression::Term’
return nullptr;
^~~~~~~
There’s nothing wrong with that code, and it compiles just fine for me, in XCode 4.3… No idea what you might have done that would break it. Are you building with gcc or clang?
Are you using Apple LLVM 3.1? Try making a fresh xcode static library project from scratch (without IntroJucer) and add the module containing juce_Expression.cpp and you will see this error.
fixes most compile errors. There are a few more that should be changed to “return TermPtr()” and “return ReferenceCountedObjectPtr()” instead of “return nullptr” but not many before all errors are fixed. I am not sure why this is needed but Xcode / the default compiler for MacOS, Apple LLVM compiler 3.1 insists.
I think I see what’s going on here. Your xcodeproj is either old, or generated by Introjucer. Since then, Apple has added some new configuration options in the Build settings. For example, the JUCE xcodeproj files don’t have “Automatic Reference Counting” set at all on the Project (inheriting the Mac OS Default of “No”). A new xcodeproj created in Xcode will have this set to “No” on the Project target.
Try using XCode to create a new project file, and add juce_core.cpp to it and you will get this error.
Compiler “LLVM GCC 4.2” (default with Xcode 4.3, Mac OS targets), “C++ Language Dialect”: “C++11” and “C++ Standard Library”: “libc++ (LLVM C++ standard library with C++11 support)” fixes the compile errors without the need for any changes to the code.