How do I build a VST plugin on Mac without using Xcode? (I'm using Code::Blocks).
2 Answers
If you really insist on bypassing Xcode, you should just go ahead and use 'make', which probably will prove to be just as much of a pain as trying to use Code::Blocks. Although Xcode might feel strange at first, it will really save you a lot of headache to drink the kool-aid and deal it, especially if you plan on developing commercial VST plugins. If you dislike it's editor, for instance, then you can easily replace it with another one of your choosing. But speaking as a fellow Mac VST developer here, Xcode's biggest advantage is really that it's good at taking care of "mac-centric" stuff; ie, building proper bundles, universal binaries, resource editing, linking against system frameworks, etc. Plus, all of the documentation you'll find out there (plus other online VST dev communities like KVR) are Xcode users.
Anyways, should you choose not to heed my advice, it should still be possible to do it the old fashioned way. :)
In principle, a VST is basically just a dynamic library bundle, so regardless of the IDE you're using, you just need to make sure that it is packaged correctly and contains the appropriate resources, or else the host won't be able to load it. If you don't know exactly what that includes, just poke around in some other VST's and see what they've got inside of the bundles. To build, you compile your sources plus the VST SDK, and link the following frameworks to it:
- ApplicationService
- Carbon
- QuickTime
- System
...and you'll probably need some others, depending on what parts of Carbon you end up using. You should also build as a UB, or else you'll end up really irritating a lot of producers still using G4/5's. Then, you need to create a PkgInfo file which will go into the bundle's resource directory, which must contain the text: "BNDL????" (no quotes, of course). You also must create a standard Info.plist file for your plugin, which will point the system to the name of the actual executable filename which gets loaded and some other information which shows up in the Finder. Again, if you don't know what needs to be there, borrow a copy from a working VST and edit to taste.

- 39,067
- 29
- 104
- 160
-
I disagree. With the ability to use Makefiles, setting up Makefile commands will prove to be much more useful in the future when something goes wrong in your IDE (due to updating Xcode, upgrading MacOS, or porting to Windows or Linux) or when you need to add a special optimization, link an unusual library, or automate build systems with continuous integration. The knowledge gained by correct Makefile use, which includes the ability to understand compiler commands, is more easily spread on forums and StackOverflow, instead of just saying "I don't know, my IDE does it for me". – Vortico Oct 27 '17 at 23:50
I did this tonight when I found that VSTGL's Xcode project was so old that Xcode 4.1 wouldn't even offer to upgrade it. Just said 'too old' and punched me in the bread basket.
I put together a simple Makefile that I just added 'missing' parts to as it became obvious I needed them.
Note that VSTGL comes with a ppc compiled VST which I just replaced with my newly compiled bundle, there's the layout of the Foo.app/Contents/[Resources|Info.plist|etc] that this makefile does not address, it just compiles it up into a valid VST bundle.
One other gotcha for me was, when testing this out I was using Ableton Live which I did't realize was 32bit (even on Lion), which is why I omit '-arch x86_64', but if you have a 64bit host it should work?
Also, it looks like even in the VST 3.0 SDK, they're still using straight up Carbon, with no Cocoa in sight. (Not that I'd be so inclined I guess, but again, with Lion you get a lot of deprecated stuff.
INCLUDES = \
-IVSTGL \
-I../vstsdk2.4/ \
-I../vstsdk2.4/public.sdk/source/vst2.x/
LIBS = \
-framework OpenGL \
-framework GLUT \
-framework AGL \
-framework Carbon \
-framework CoreServices
SOURCES = \
VstPlugin.cpp \
ExampleEditor.cpp \
VSTGL/VSTGLEditor.cpp \
VSTGL/VSTGLTimer.cpp \
../vstsdk2.4/public.sdk/source/vst2.x/audioeffect.cpp \
../vstsdk2.4/public.sdk/source/vst2.x/audioeffectx.cpp \
../vstsdk2.4/public.sdk/source/vst2.x/vstplugmain.cpp
all:
g++ -arch i386 $(INCLUDES) -bundle -o VSTGL.vst/Contents/MacOS/VSTGL $(SOURCES)

- 27,321
- 5
- 74
- 91