VST2.4 and VSTGUI 3.6rc2 under MacOSX10.8 and X-Code 4.6.2

DSP, Plugin and Host development discussion.
RELATED
PRODUCTS

Post

Hello there,

I've just finished a 32 bit VST2.4 for Windows, using VSTGUI 3.6 rc2 for the graphic interface (with PNGs using GDI+).
Result is excellent.

Now I'm trying to port it for a MAC version.
I'm really good at C++, but I'm totally a newbie on X-Code (and Objective-C).
I've spent the last 3 days to look around the internet to find some hints and explanation on how to compile Steinberg's SDKs on that platform, and also reading the x-code documentation to try to understand how to configure the compiler, and maybe do some adaptations to VST2.4 and VSTGUI 3.6 rc2 SDKs.
On this forum, obviously some people already did it, so I'm already certain that it is not impossible !

First question : is there some code portions of Steinberg's SDKs that are in Objective-C, or are they fully made of C++ ?? (tried to review all the code, but didn't see anything else than C++ to my eyes)
Because when I set the "Compile Source As" parameter to "According to file type", I get this error :
error: -fobjc-arc is not supported on platforms using the legacy runtime
.

And if I set it to "C++" I've got a lot of parse issues, like "Unknown type name 'NSString'", which I think it's related to Objective-C, right ?

So, do someone have some hints / ideas / all-included-tutorial / working example / detailed configuration / etc, to propose ??

Any help would be really more than welcome !! :help:

Thanks in advance ! :)

Post

Hello!

The VSTGUI contains some Objective-C++ code in CocoaSuppport.mm.

I assume you've seen my instructions on this thread:
http://www.kvraudio.com/forum/viewtopic ... sc&start=0

I could compile a Mac VST with

VST SDK 2.4 rev 2

VSTGUI 3.6 from SVN (i.e. pulled from the VSTGUI repository using svn tool)

I don't know how difficult it will be to compile a VST plugin on the library versions you have. They are both different from what i used.

Post

FBO wrote:Hello there,

I've just finished a 32 bit VST2.4 for Windows, using VSTGUI 3.6 rc2 for the graphic interface (with PNGs using GDI+).
Result is excellent.

Now I'm trying to port it for a MAC version.
I'm really good at C++, but I'm totally a newbie on X-Code (and Objective-C).
I've spent the last 3 days to look around the internet to find some hints and explanation on how to compile Steinberg's SDKs on that platform, and also reading the x-code documentation to try to understand how to configure the compiler, and maybe do some adaptations to VST2.4 and VSTGUI 3.6 rc2 SDKs.
On this forum, obviously some people already did it, so I'm already certain that it is not impossible !

First question : is there some code portions of Steinberg's SDKs that are in Objective-C, or are they fully made of C++ ?? (tried to review all the code, but didn't see anything else than C++ to my eyes)
Because when I set the "Compile Source As" parameter to "According to file type", I get this error :
error: -fobjc-arc is not supported on platforms using the legacy runtime
.
There may be a small amount of Objective-C in the VST SDK, but there definitely is in VSTGUI. That error is happening because you have ARC (automatic reference counting) turned on, which is not supported on the i386 architecture. You'll need to turn ARC off by going into the build settings of your Xcode project, search for ARC, and then set "Use Automatic Reference Counting" to no.
FBO wrote: And if I set it to "C++" I've got a lot of parse issues, like "Unknown type name 'NSString'", which I think it's related to Objective-C, right ?
Yes, NSString is Obj-C. As I said, there is objective C in VSTGUI to handle the interface.
FBO wrote: So, do someone have some hints / ideas / all-included-tutorial / working example / detailed configuration / etc, to propose ??

Any help would be really more than welcome !! :help:

Thanks in advance ! :)
Another build setting you need to modify is "Implicitly Link Objective-C runtime" -- set it to no.

There should be an example Xcode project in the VSTSDK, as well as in the VSTGUI SDK. That should give you a good starting point. Also, VSTGUI needs the OS X 10.6 SDK to compile. If you don't have it, you'll need to download Xcode 3 and pull it out from there and copy it into the right place in the Xcode 4 bundle (assuming you're on Xcode 4).

Fortunately it's not that complicated to get up and running in Xcode. As long as you follow the example project, you should be able to resolve any dependency issues if they arise.

Post

Thanks a lot for the replies.
I'm currently trying all of your hints.
The VSTGUI contains some Objective-C++ code in CocoaSuppport.mm.

Ok so should I set the "Compile Source As" parameter to "According to file type" ?
I assume you've seen my instructions on this thread:
http://www.kvraudio.com/forum/viewtopic ... 58&postday s=0&postorder=asc&start=0
Yes, but I'm not sure about that point :
In x-code 4.6.2 if I set the "OS X Deployment Target" parameter to "OS X 10.6", does that mean x-code will use the OS X 10.6 SDK or not ?
Should I really install an older version of X-code ?

Post

FBO wrote:
I assume you've seen my instructions on this thread:
http://www.kvraudio.com/forum/viewtopic ... 58&postday s=0&postorder=asc&start=0
Yes, but I'm not sure about that point :
In x-code 4.6.2 if I set the "OS X Deployment Target" parameter to "OS X 10.6", does that mean x-code will use the OS X 10.6 SDK or not ?
Should I really install an older version of X-code ?
No. To set the SDK, you specify it in "Base SDK" in the build settings. And no, you don't need an earlier version of Xcode, you just need the 10.6 SDK. But since it doesn't ship with Xcode 4 anymore, you have to obtain it from downloading Xcode 3 and then copying it over into the Xcode 4 bundle (right-click, show package contents, and navigate to the folder with the MacOSX SDKs).

Post

Okay got it. Any idea where I can find it ? Do I have to search a torrent? because all download links I've found are dead..

Post

I wonder if you could use the refactor function in Xcode ?

Menu-> Edit -> Refactor -> Convert to .... ?

I am no way an xcode expert (yet :) ) but I know I've used that for some legacy c++ code some time ago.

Apologies if I am pointing in the wrong direction...

Post

OS X 10.7 SDK was installed on my system and I gave it a try.
Now I only have 3 semantic errors left (all in cocoasupport.mm) !
Do you think I have a chance to correct these without the need of installing OS X 10.6 SDK ? Is it worth trying ?

@vivo : Interesting. But I prefer not to activate such automatic function on Steinberg's SDKs... I don't know, I've got the intuition that it wouldn't be a good idea. I'll keep that in mind though.

Post

FBO, found this link, maybe it's useful.

http://sample-hold.com/2011/11/23/getti ... ode-4-2-1/

Only it's for AU plugins.

This one is older but for vst


https://ccrma.stanford.edu/~kapilkm/220c/Vst_XCode.html


(i searched it because I find it an interesting subject/problem)

Post

FBO wrote:OS X 10.7 SDK was installed on my system and I gave it a try.
Now I only have 3 semantic errors left (all in cocoasupport.mm) !
Do you think I have a chance to correct these without the need of installing OS X 10.6 SDK ? Is it worth trying ?
You can get Xcode right from Apple: https://developer.apple.com/devcenter/m ... #downloads
You'll have to log in with your developer account of course.

Post

vivo wrote:FBO, found this link, maybe it's useful.

http://sample-hold.com/2011/11/23/getti ... ode-4-2-1/

Only it's for AU plugins.

This one is older but for vst


https://ccrma.stanford.edu/~kapilkm/220c/Vst_XCode.html


(i searched it because I find it an interesting subject/problem)
thanks for the links. however, my VST is already all set (I'll see later if I'll do a AU version, but first I want to adapt my Windows VST to a OSX VST).
I already followed this detailed procedure for the xcode vst project creation and setup :
http://teragonaudio.com/article/Making- ... Xcode.html

Post

FBO wrote:OS X 10.7 SDK was installed on my system and I gave it a try.
Now I only have 3 semantic errors left (all in cocoasupport.mm) !
Do you think I have a chance to correct these without the need of installing OS X 10.6 SDK ? Is it worth trying ?
In my experience no, don't waste your time trying to build VSTGUI 3.x against OS X SDK version greater than 10.6. But if you make it, be sure to tell us all about it! :)

Post

mfa wrote:But if you make it, be sure to tell us all about it! :)
Xcode 3 and OSX 10.6 SDK are downloading... sorry... :P

Post

mfa wrote:But if you make it, be sure to tell us all about it! :)
Xcode 3 and OSX 10.6 SDK are downloading... sorry... :P

Post

FBO wrote:I already followed this detailed procedure for the xcode vst project creation and setup :
http://teragonaudio.com/article/Making- ... Xcode.html
IIRC i first went that way too, but it didn't quite work for me, those instructions may not be 100% valid on the latest Xcode.
FBO wrote:
mfa wrote:But if you make it, be sure to tell us all about it! :)
Xcode 3 and OSX 10.6 SDK are downloading... sorry... :P
Good for you. :)

If your plugin won't build even after you've copied the OS X SDK 10.6 into your Xcode 4.x bundle, i strongly urge you to build the tutorial project included in VSTGUI and, once you get that working, work your way from there. It's so much easier to compare your configuration against a project you know is working. Good luck!

Post Reply

Return to “DSP and Plugin Development”