Linker errors when compiling VST3 with other formats

This change:


can cause linker errors if an AudioProcessor derived class is compiled in the per-format code.

The linker errors happen if compiling VST3 alongside any other format and only for the other format(s). This is because the shared code sees the AudioProcessor class with the vst3IsPlaying member declared, and the format-specific code for non-VST3 formats see the class without that member declared (due to the JucePlugin_Build_VST3 definition being set per-format).

Please confirm the issue and review this change.

Edit:
Note that the exact conditions under which linker errors were seen were when using an AudioProcessor derived class template compiled in the shared code, with a per-format class derived from the class template compiled in each of the per-format projects/targets.

2 Likes

So it’s just a case of removing the #if JucePlugin_Build_VST3 guard?

1 Like

Yep, that’s it.

Edit:
Actually you probably still want it to surround the VST3-specific friend declarations.

Fixed.

It’ll appear on the master branch too, once it clears our CI testing.

1 Like