NKS Support

Hi @attila ! In our plugins We need to include specific VST SDK files for support NKS.
Commit [50f341588] broke our system and to fix it would be enough to rename AEffect in juce_ExtensionsVisitor.h to something like JUCE_ AEffect so as not to create conflict with the structure of VST2.

Hi @dev1am,

I am looking into this and trying to understand what is the exact cause of the compilation error. The forward declarations are meant to be exact copies of those in the SDKs, and ideally shouldn’t collide with them.

There is a small difference though. Can you check if replacing line 47 of juce_ExtensionsVisitor.h with the following line solves the problem for you?

typedef struct AEffect AEffect;

If not, can you tell me which VST2 SDK version are you using?

Replacing line 47 of juce_ExtensionsVisitor.h with
typedef struct AEffect AEffect;
doesn’t help, this is the error:

I’m using SDK version 3.6.11, the version of VST2 SDK is 2.4

The issue is that I have to include in my project this file:

namespace Vst2
{
#include "pluginterfaces/vst2.x/aeffect.h"
#include "pluginterfaces/vst2.x/aeffectx.h"
}

for support NKS format

I think the issue is that you include the VST headers inside a namespace, and the typedef above will bind AEffect to the forward declared struct AEffect in the global namespace, which then will collide with the struct AEffect definition in the Vst2 namespace.

A workaround could be adding a Vst2::AEffect declaration like so

namespace Vst2
{
struct AEffect;
#include "pluginterfaces/vst2.x/aeffect.h"
#include "pluginterfaces/vst2.x/aeffectx.h"
}

Can you check if that solves your problem?

2 Likes

Yep! Adding struct AEffect; works, thanks so much for the support!

Ups, this change seems that works fine for VST but broke VST3

I can solve adding struct AEffect; at line 68 of juce_VST3_Wrapper.cpp

Thank you for reporting. A fix is now out on develop.

2 Likes

Thanks for the quick fix!