Dev-C++ Compiling VST Steps


#1

10 Steps to compiling a JUCE based VST with Dev-C++

I take no credit for this… I just applied the methods used to get the VSTGUI functional in Dev-C++ to JUCE as the GUI.

1.Create a new project dll project and deleted the generated .cpp and .h files.

2.Add the VST plugin sourcefiles to your project (I include the headers too)

  • juce_AudioFilterBase.cpp
  • juce_audioFilterBase.h
  • JuceVstMain.cpp
  • juce_CreateFilter.h
  • and the files which contain “your” vst code which should be based on the DemoJuceFilter.cpp and DemojuceFilter.h provided with JUCEAudioPlugin.zip

3.Add the /common directory from within the VST SDK to your Dev-C++ include directory.

4.Add the following VST ‘common’ source files to the project

  • AudioEffect.cpp
  • audioeffectx.cpp

5.Personally I like adding the new /common directory to the tools/compiler options/directories/include dialog as opposed to the project (alt+p) because I don’t plan on doing much other than JUCE type development with it.

6.inssure that your project options (alt+p) directories OR compiler options directories have the following.

  • library: /juce/bin (where libjuce.a is located).
  • includes: /juce (wher juce.h is located).

7.Modify the JuceVstMain.cpp file

repalce:

[code]#else
__declspec(dllexport) AEffect* main (audioMasterCallback audioMaster)
{

with:

[code]#else
extern “C” __declspec(dllexport) AEffect* main_plugin (audioMasterCallback audioMaster) asm(“main”);

AEffect* main (audioMasterCallback audioMaster)
{[/code]

also replace:

#ifdef JUCE_WIN32 BOOL WINAPI DllMain (HINSTANCE instance, DWORD dwReason, LPVOID)

with:

#ifdef JUCE_WIN32 extern "C" BOOL WINAPI DllMain (HINSTANCE instance, DWORD dwReason, LPVOID)

8.Create a file <name_of_your_plugin>.def with a text editor which has the fllowing:

9.Go to Project Options (Alt+P), select parameters, and insure the following are listed in the linker window.

-ljuce
-lmsvfw32
-lwinmm
-lrpcrt4
-lgdi32
–def <name_of_your_plugin>.def

10.Build and copy <name_of_your_plugin.dll> into the VST plugin directory of your host

As observed by others, it looks like it only works properly with Tracktion at the moment… but hell after a day of Dev-C++ hell, I’m FUCKING HAPPY! :smiley:

Let me know if I’ve screwed up somewhere… :oops:


#2