xCode question


#1

I am porting a plugin from my PC over to the Mac and I'm having some trouble getting it to compile. The issue is that I'm getting compile errors in the VST3 SDK due to incompatibilities with the C++ 11 standard. I'm using xCode 7 and I can't find any settings that will let me enable/disable C++ 11 compliance. Am I missing something? I'm using version 3.6.0 of the VST SDK. Would updating to version 3.6.5 fx the issue or should I use an older version of xCode?


#2

What issues are you having specifically? The VST3 SDK should compile fine with C++11,

that being said, here's how you switch C++11 on and off:

In Introjucer: Config -> Xcode (MacOSX) -> Debug / Release and then on the right: C++ Language Standard and C++ Library. (with C++11 and C++14 you should use libc++, with C++98 libstdc++

In Xcode 6: the same settings are available in Build Settings -> Apple LLVM 6.1 - Language - C++

(don't know how that may have changed in Xcode 7, didn't try that yet)


#3

There were a couple of casting errors related to C++ 11. These seem to be fixed in the newest VST3 SDK (3.6.5) so I'm using that now. However I'm now getting a "redefinition of iid" error relating to a namespace that seems to be defined both in the VST3 SDK (baseiids.cpp) and in juce_VST3Headers.h, which is included in juce_VST3Wrapper.cpp.

Also, there seems to be no Build Settings menu item in xCode 7 although it is possible that I'm just missing it. I'm fairly new to xCode and still finding my way around.

I'm thinking about rolling back to xCode 6 to see if that solves the problem, although it would probably not be a bad idea to make this work with xCode 7. 


#4

Interesting. I switched to xCode 6 and I'm getting the same error. 

This is the offending declaration.

 

// From VST3 SDK baseiids.cpp

namespace Steinberg {

DEF_CLASS_IID (FUnknown)
DEF_CLASS_IID (IString)
DEF_CLASS_IID (IStringResult)
DEF_CLASS_IID (IDependent)
DEF_CLASS_IID (IUpdateHandler)
DEF_CLASS_IID (IPersistent)
DEF_CLASS_IID (IAttributes)
DEF_CLASS_IID (IAttributes2)
DEF_CLASS_IID (ICloneable)
DEF_CLASS_IID (ISizeableStream)
}

 

// From juce_VST3Headers.h

namespace Steinberg
{

    /** Missing IIDs */

    DEF_CLASS_IID (IPluginBase)
    DEF_CLASS_IID (IPlugView)
    DEF_CLASS_IID (IPlugFrame)
    DEF_CLASS_IID (IBStream)
    DEF_CLASS_IID (ISizeableStream)
    DEF_CLASS_IID (IPluginFactory)
    DEF_CLASS_IID (IPluginFactory2)
    DEF_CLASS_IID (IPluginFactory3)
}

It looks like ISizeableStream appears in both places and is causing a compile error. If I comment out that line, everything compiles, but I'm not sure if that will have any undesirable consequences.


#5

Are you using the latest version? Thought we fixed something like this last week.


#6

I'm using 3.2.0. I have been wary of using the tip because I don't want to let any bugs or instabilities creep in. This is a port of a production level module and I want to release it as soon as I can get it tested stabilized. How would you suggest I proceed?


#7

Well, it's up to you what you choose to do about updating, but please always check the tip before reporting bugs - this is almost certainly already fixed.


#8

That's all well and good but one could reasonably assume that the latest "production" build of JUCE (3.2.0) would not cause compile errors with the VST SDK. Perhaps a maintenance branch/tag with minor fixes such as this one might be appropriate, as opposed to requiring your customers to search through change logs and build their own stable versions.