hibrasil wrote:forcing it is not going to work... you're going to need to compile those .mm as objc++
I think this might be something to do with the precompiled header. Maybe try disabling it / having a look at the PCH settings in tutorial vs yours? GCC_PRECOMPILE_PREFIX_HEADER
I'm looking at this at the target level now as I noticed some project settings don't match the projects. (For example I didn't have VSTGUI_ENABLE_DEPRECATED_METHODS=0 set in Preprocessor Macros for my individual targets, even though it was in the project. Man this is confusing compared to VS!)
And taking a look at the PCH stuff...
Both match (at the target level), only difference is the name of the Prefix Header (tutorial_Prefix.pch on the tutorial, xcode_vst_prefix.h on my project).
Any other differences?...
Compile Sources As (which I'm going to turn back to According To File Type).
Some optimization options are different in my Release version. That can't be it. (And I'm compiling the Development build anyway, which is the same.)
Prebinding was on. Off now to match tutorial.
Everything else matches exactly (excepting where the project name is used). Let's try this again...
Back to those same "Expected..." errors in vstgui.h
Now I'm removing #include <Carbon/Carbon.h> as suggested by C.Kerry, above. My pch file (xcode_vst_prefix.h) now matches tutorial's exactly, having only one line, #include "vstgui.h"
Compiling... errors. Strangely it seems to compile xcode_vstprefix.h 3 times. The first time through it complains about the line AFTER the BEGIN_NAMESPACE_VSTGUI line (vstgui.h 183) that "CFBundleRed does not name a type". So that would seem to indicate I need to put back the #include <Carbon/Carbon.h> But why doesn't the tutorial project need to do this? Several more of the same error for CGContextRef, CGImageRef, etc. And then the 2nd time it says it's compiling xcode_vst_prefix.h, it goes back to that previous "Expected..." error on the BEGIN_NAMESPACE_VSTGUI line! WTF!?!
Okay, trying one more thing, let's turn off this precompiled header entirely and see what happens... (I understand how these work on VS in Windows but I'm frankly a little hazy as to why we define it explicitly in XCode, I'm used to it being completely automatic.)
Turning "Precompile Prefix Header" off for my target. (Assuming it won't hurt to leave the filename in Prefix Header? Or is that a safe assumption in this particular funhouse?)
Compiling (and yes, I clean all targets every time whenever nonsense like this is happening)...
Same errors, "CFBundleRef does not name a type", etc. Yet both vstgui.h and aeffguieditor.cpp #include <Carbon/Carbon.h>