Cannot build audiopluginhost on Windows


Hi, getting following errors as if the VST2 files cannot be located. Actual plugins build fine:

Severity Code Description Project File Line Suppression State
Error (active) E1696 cannot open source file “pluginterfaces/vst2.x/aeffect.h” AudioPluginHost_App c:\Users\leehu\Dev\JUCE\modules\juce_audio_processors\format_types\juce_VSTPluginFormat.cpp 44
Error (active) E1696 cannot open source file “pluginterfaces/vst2.x/aeffectx.h” AudioPluginHost_App c:\Users\leehu\Dev\JUCE\modules\juce_audio_processors\format_types\juce_VSTPluginFormat.cpp 45



Since the changes with the VST SDK you’ll need to re-save the AudioPluginHost project with the latest Projucer and ensure that the “Custom VST3 SDK” path is empty here:


ah thanks, didn’t realise I had to unset that field. works now, thanks


You can also keep a valid path in the “Custom VST3 SDK” field, but the VST3 SDK needs to contain the vst2 header files. The github repo does not contain them. You can, however, download the SDK from steinberg’s webpage directly and execute the copy script in the root folder.


Hi, I did have a VST3 install with the VST2 SDK in it - all that changed was updating to latest dev tip and rebuilding Projucer.


Hmmm I specifically tested this case. Did you also run Steinberg’s copy script? The VST2 headers should end up in /some/path/VST_SDK/VST3_SDK/pluginterfaces/vst2.x and the “Custom VST3 SDK” field should point to /some/path/VST_SDK/VST3_SDK.


Will check again, but I’ve def run that in the past


I found issues compiling under MacOS…

I had to add

struct VstEditorBounds
int16 upper;
int16 leftmost;
int16 lower;
int16 rightmost;

back into juce_VSTPluginFormat.cpp (since the header where it was defined has been removed).

I added it at:

    struct VstEditorBounds
    int16 upper;
    int16 leftmost;
    int16 lower;
    int16 rightmost;
    struct CarbonWrapperComponent   : public CarbonViewWrapperComponent

I also had to add

 using namespace Vst2;

back in at the top after the

namespace Vst2
#include <pluginterfaces/vst2.x/aeffect.h>
#include <pluginterfaces/vst2.x/aeffectx.h>

using namespace Vst2;



I’m finding that the VST hosting isn’t right since this commit… it’s related to the editor size being returned as a width and height of 1 pixel… probably related to your removing the VstEditorBounds struct in the commit… where it still works on MacOS because I added the struct declaration back in.



Exactly how are you building this? I just tested compiling the plugin host on windows 10 64-bit with VST hosting and it works without any hacks (Ed’s been testing this as well on his machine - and our CI system builds the plugin host with VST hosting on every commit). You shouldn’t need to add any definitions etc.

I tested both just straight opening the host’s VS solution file after a repo pull and re-saving it with the Projucer.


I updated the JUCE modules… and added the vst2.x folders to the SDK in their original location… and built my existing plug-in with no other changes… and hosting works fine on MacOS with the changes above… but on Windows VST2 is broken and VST3 is fine. Debugging shows that the editor reports a size of 1 pixel wide and 1 pixel high.

I don’t use PJ for my project… IJ was used to create it originally, but since then I maintain it manually.

I’ll go ahead and build the host on Windows and test it here.

I had to add the struct back for MacOS to compile.

To clarify, I’m not using the new embedded SDK, but the existing SDK i was using before this commit with the addition of the vst2.x folder.



Then try creating a project (or the audio demo host) with the Projucer and look at how we changed the header search paths. However, remember to remove the “Custom VST3 Path” as Ed states in his post above.

This is not necessary if the project is saved correctly with the Projucer. Again our CI would moan if this were a problem.


How could that be?? Line 3272…

        bool getEmbeddedViewSize (int& w, int& h) override
            VstEditorBounds* rect = nullptr;
            owner.dispatch (effEditGetRect, 0, 0, &rect, 0);
            w = rect->rightmost - rect->leftmost;
            h = rect->lower - rect->upper;
            return true;

must have complained

if the code’s not excluded because of the barrier macros




I shouldn’t have to change my VST search paths or locations… I’m still using my external SDK copy with the added vst2.x folder – unless you’re implying there’s more than those headers different in your SDK copy and the Steinberg copy.

My plug-in compiles fine… the only issue is the VST2 editor size being reported wrong.



OK. Our CI doesn’t build for carbon anymore. I’ve fixed this and it should appear on develop shortly.


You can do this as well with the Projucer by changing the “Custom VST3 SDK” field. I just tried this and it works as expected. Where exactly is a 1 pixel size being returned?


When I create my PluginWindow (DocumentWindow)… when I use

 setContentOwned (pEditor, true);

if I look at the bounds for pEditor… for VST2 in this commit it always returns 1 pixel for width and height… this works fine before the commit.

About to try building the JUCE Host to test on Windows…



If you look at the commits diff here:

(the link takes a long time to load - give github a few seconds and it will jump to the correct line)
then you can see that we are really just doing the following replacements:

plugInOpcodeGetEditorBounds -> Vst2::effEditGetRect
VstEditorBounds -> Vst2::ERect
w = rect->rightmost - rect->leftmost; h = rect->lower - rect->upper; -> w = rect->right - rect->left; h = rect->bottom - rect->top;

I can’t really see anything wrong there. Can you spot anything?


So while the Host works… it does report the wrong size… I have to have the correct size reported because I have a toolbar and change the Window width to make sure things fit…

Note the bounds size is 1 x 1

I’ll examine your changes more closely to see where the issue is.



Okay… This was brand new code for my plug-in… so I have to verify what the code did in the pre-VST change commit to make sure my report is accurate…

     const double dToolbarWidth = 411.0;

    Rectangle<double> editorRect = pEditor->getBounds().toDouble();
    if (editorRect.getWidth() < dToolbarWidth)
        setContentOwned (pEditor, bIsTheGlue || bIsValhalla);  // TheGlue and Valhalla are fully scalable and need to allow the Window to be resized.
        setContentOwned (pEditor, true);

On MacOS and Windows with VST3 editorRect is the correct size before setContentOwned() is called which calls openPluginWindow() where the editor size is checked.

On MacOS editorRect is the correct size before setContentOwned() is called for all plug-in formats (VST2, VST3 and AU).

On Windows for VST2, editorRect shows the editor width and height to be 1 pixel before setContentOwned() is called.


I’ll revert my code and let you know if this is new since the VST2 changes to JUCE.