VST 3.6.11 IDropTarget compile errors on Windows

A user interface toolkit mainly for audio plug-ins (VST, AudioUnit, etc).
squarewave
Posts: 7
Joined: Fri May 25, 2018 9:30 pm

VST 3.6.11 IDropTarget compile errors on Windows

Postby squarewave » Sat Nov 24, 2018 10:56 pm

So, I tried updating to the new VSTGUI version.

IDropTarget has name collision with Win32 OLE struct.
OLE spams its name into global namespace with no sensible restraints (#if block etc)

Normally, one just defines WIN32_MEAN_AND_LEAN to be rid of lots of crud,
but D2D drawing headers include oleidl.h etc, so this doesn't work.

How do you get it to compile on your machines?
To me the simplest is just to rename VSTGUI IDropTarget, it's going to cause grief to more people.

Any advise appreciated.

Thanks,
/rasmus

Arne Scheffler
Posts: 216
Joined: Mon Jun 20, 2016 7:53 am

Re: VST 3.6.11 IDropTarget compile errors on Windows

Postby Arne Scheffler » Mon Nov 26, 2018 4:17 pm

This can only happen if you have somewhere "using namespace VSTGUI" in your header.
So remove it.

Cheers,
Arne

squarewave
Posts: 7
Joined: Fri May 25, 2018 9:30 pm

Re: VST 3.6.11 IDropTarget compile errors on Windows

Postby squarewave » Tue Nov 27, 2018 12:10 am

Ah. Thanks for that. I had it in one place, removing that cleared up my code.

But...

Now these lines would never work in /vstgui/vstgui.h : 68

Code: Select all

#if !defined (VSTGUI_DISABLE_GLOBAL_NAMESPACE_POLLUTION) || VSTGUI_DISABLE_GLOBAL_NAMESPACE_POLLUTION == 0
using namespace VSTGUI;
#endif

So that macro needs to be defined always?

When I define it in my project it seems we need a couple of fixes in aeffguieditor.h/cpp

aeffguieditor.h : 21
class AEffGUIEditor : public AEffEditor, public VSTGUI::VSTGUIEditorInterface

aeffguieditor.h : 59
virtual bool beforeSizeChange (const VSTGUI::CRect& newSize, const VSTGUI::CRect& oldSize);

and the same in aeffguieditor.cpp : 113
int32_t AEffGUIEditor::knobMode = VSTGUI::kCircularMode;

and aeffguieditor.cpp : 204
bool AEffGUIEditor::beforeSizeChange (const VSTGUI::CRect& newSize, const VSTGUI::CRect& oldSize)

Am I missing something else?

=====
EDIT next day:

I managed to compile without the VSTGUI_DISABLE_GLOBAL_NAMESPACE_POLLUTION macro,
while also getting away from the IDropTarget redefinition errors.

This is done by moving
#include <windows.h>

so that it precedes any vstgui header inclusion.
At least in aeffguieditor.cpp as well as any of your own files (your AudioEffectX implementation file for instance)

And you need to
#undef max
#undef min

EDIT next day
(and define UNICODE in preprocessor flags, else aeffguieditor.cpp fails. I probably lost that while fiddling the other flags)
Was in this edit, but it's irrelevant to thread topic, so removed now.

=====

Thanks,
/rasmus

Arne Scheffler
Posts: 216
Joined: Mon Jun 20, 2016 7:53 am

Re: VST 3.6.11 IDropTarget compile errors on Windows

Postby Arne Scheffler » Wed Nov 28, 2018 5:19 pm

Hi rasmus,
please checkout the master branch from GitHub (https://github.com/steinbergmedia/vstgui).
It should contain the necessary fixes to get you going and let me know if it works for you.

Cheers,
Arne

squarewave
Posts: 7
Joined: Fri May 25, 2018 9:30 pm

Re: VST 3.6.11 IDropTarget compile errors on Windows

Postby squarewave » Thu Nov 29, 2018 2:50 am

Ah, I got it working in the end, but much better to have the official.

Thanks for quick fix!

/rasmus


Return to “VSTGUI”

Who is online

Users browsing this forum: No registered users and 1 guest