Dec 11, 2011 at 10:37pm UTC
Hi all. I've done my best to research this myself but I've got some linker errors I just can't get rid of, all related to inherited virtual functions. I'm trying to override two virtual functions, open() and close(), from the VST3 SDK. I think all relevant code is below, class declarations are from different files but linked with appropriate #include directives. Any help appreciated, thanks very much.
Base class - from VSTGUIEditor.h
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
class VSTGUIEditor : public EditorView, public VSTGUIEditorInterface, public CBaseObject
{
public :
/** Constructor. */
VSTGUIEditor (void * controller, ViewRect* size = 0);
/** Destructor. */
~VSTGUIEditor ();
//---Internal function-----
/** Called when the editor will be opened. */
virtual bool PLUGIN_API open (void * parent) = 0;
/** Called when the editor will be closed. */
virtual void PLUGIN_API close () = 0;
/** Sets the idle rate controlling the parameter update rate. */
void setIdleRate (int32 millisec);
//---from CBaseObject---------------
CMessageResult notify (CBaseObject* sender, const char * message);
void forget () { EditorView::release (); }
void remember () { EditorView::addRef (); }
VSTGUI_INT32 getNbReference () const { return refCount; }
//---from IPlugView-------
tresult PLUGIN_API isPlatformTypeSupported (FIDString type);
tresult PLUGIN_API onSize (ViewRect* newSize);
//---from VSTGUIEditorInterface-------
/** Called from VSTGUI when a user begins editing.
The default implementation calls performEdit of the EditController. */
void beginEdit (VSTGUI_INT32 index);
/** Called from VSTGUI when a user ends editing.
The default implementation calls endEdit of the EditController. */
void endEdit (VSTGUI_INT32 index);
VSTGUI_INT32 getKnobMode () const ;
private :
//---from IPlugView-------
tresult PLUGIN_API attached (void * parent, FIDString type);
tresult PLUGIN_API removed ();
tresult PLUGIN_API onKeyDown (char16 key, int16 keyMsg, int16 modifiers);
tresult PLUGIN_API onKeyUp (char16 key, int16 keyMsg, int16 modifiers);
tresult PLUGIN_API onWheel (float distance);
CVSTGUITimer* timer;
};
Derived class - from vst3call.cpp. Calling VSTGUIEditor constructor.
1 2 3 4 5 6 7 8 9 10 11 12
class myclass : public VSTGUIEditor
{
public :
//------------------------------------------------------------------------
myclass (void * controller, ViewRect* size)
: VSTGUIEditor (controller, size)
{}
bool PLUGIN_API open (void * parent);
void PLUGIN_API close ();
};
Creating instance of inherited class - from vst3call.cpp
myclass testinstance (&objs,&err);
Where parameters &objs and &err are (I think)correctly initialised for the VSTGUIEditor constructor.
And to the linker errors:
Error 21 error LNK2019: unresolved external symbol "public: __thiscall Steinberg::Vst::VSTGUIEditor::VSTGUIEditor(void *,struct Steinberg::ViewRect *)" (??0VSTGUIEditor@Vst@Steinberg@@QAE@PAXPAUViewRect@2@@Z) referenced in function "public: __thiscall Steinberg::Vst::myclass::myclass(void *,struct Steinberg::ViewRect *)" (??0myclass@Vst@Steinberg@@QAE@PAXPAUViewRect@2@@Z) C:\...\VST3 GUI take3\vst3_call.obj
Error 22 error LNK2001: unresolved external symbol "public: virtual void __thiscall Steinberg::Vst::EditorView::attachedToParent(void)" (?attachedToParent@EditorView@Vst@Steinberg@@UAEXXZ) C:\...\VST3 GUI take3\vst3_call.obj
Error 23 error LNK2001: unresolved external symbol "public: virtual void __thiscall Steinberg::Vst::EditorView::removedFromParent(void)" (?removedFromParent@EditorView@Vst@Steinberg@@UAEXXZ) C:\...\VST3 GUI take3\vst3_call.obj
Error 24 error LNK2001: unresolved external symbol "public: virtual bool __stdcall Steinberg::Vst::myclass::open(void *)" (?open@myclass@Vst@Steinberg@@UAG_NPAX@Z) C:\...\VST3 GUI take3\vst3_call.obj
Error 25 error LNK2001: unresolved external symbol "public: virtual void __stdcall Steinberg::Vst::myclass::close(void)" (?close@myclass@Vst@Steinberg@@UAGXXZ) C:\...\VST3 GUI take3\vst3_call.obj
Error 26 error LNK2001: unresolved external symbol "public: virtual long __stdcall Steinberg::Vst::VSTGUIEditor::isPlatformTypeSupported(char const *)" (?isPlatformTypeSupported@VSTGUIEditor@Vst@Steinberg@@UAGJPBD@Z) C:\...\VST3 GUI take3\vst3_call.obj
Error 27 error LNK2001: unresolved external symbol "private: virtual long __stdcall Steinberg::Vst::VSTGUIEditor::attached(void *,char const *)" (?attached@VSTGUIEditor@Vst@Steinberg@@EAGJPAXPBD@Z) C:\...\VST3 GUI take3\vst3_call.obj
Error 28 error LNK2001: unresolved external symbol "private: virtual long __stdcall Steinberg::Vst::VSTGUIEditor::removed(void)" (?removed@VSTGUIEditor@Vst@Steinberg@@EAGJXZ) C:\...\VST3 GUI take3\vst3_call.obj
Error 29 error LNK2001: unresolved external symbol "private: virtual long __stdcall Steinberg::Vst::VSTGUIEditor::onWheel(float)" (?onWheel@VSTGUIEditor@Vst@Steinberg@@EAGJM@Z) C:\...\VST3 GUI take3\vst3_call.obj
Error 30 error LNK2001: unresolved external symbol "private: virtual long __stdcall Steinberg::Vst::VSTGUIEditor::onKeyDown(wchar_t,short,short)" (?onKeyDown@VSTGUIEditor@Vst@Steinberg@@EAGJ_WFF@Z) C:\...\VST3 GUI take3\vst3_call.obj
Error 31 error LNK2001: unresolved external symbol "private: virtual long __stdcall Steinberg::Vst::VSTGUIEditor::onKeyUp(wchar_t,short,short)" (?onKeyUp@VSTGUIEditor@Vst@Steinberg@@EAGJ_WFF@Z) C:\...\VST3 GUI take3\vst3_call.obj
Error 32 error LNK2001: unresolved external symbol "public: virtual long __stdcall Steinberg::CPluginView::getSize(struct Steinberg::ViewRect *)" (?getSize@CPluginView@Steinberg@@UAGJPAUViewRect@2@@Z) C:\...\VST3 GUI take3\vst3_call.obj
Error 33 error LNK2001: unresolved external symbol "public: virtual long __stdcall Steinberg::Vst::VSTGUIEditor::onSize(struct Steinberg::ViewRect *)" (?onSize@VSTGUIEditor@Vst@Steinberg@@UAGJPAUViewRect@3@@Z) C:\...\VST3 GUI take3\vst3_call.obj
Error 34 error LNK2001: unresolved external symbol "public: virtual long __thiscall Steinberg::Vst::VSTGUIEditor::getKnobMode(void)const " (?getKnobMode@VSTGUIEditor@Vst@Steinberg@@UBEJXZ) C:\...\VST3 GUI take3\vst3_call.obj
Error 35 error LNK2001: unresolved external symbol "public: virtual void __thiscall Steinberg::Vst::VSTGUIEditor::beginEdit(long)" (?beginEdit@VSTGUIEditor@Vst@Steinberg@@UAEXJ@Z) C:\...\VST3 GUI take3\vst3_call.obj
Error 36 error LNK2001: unresolved external symbol "public: virtual void __thiscall Steinberg::Vst::VSTGUIEditor::endEdit(long)" (?endEdit@VSTGUIEditor@Vst@Steinberg@@UAEXJ@Z) C:\...\VST3 GUI take3\vst3_call.obj
Error 37 error LNK2001: unresolved external symbol "public: virtual enum VSTGUI::CMessageResult __thiscall Steinberg::Vst::VSTGUIEditor::notify(class VSTGUI::CBaseObject *,char const *)" (?notify@VSTGUIEditor@Vst@Steinberg@@UAE?AW4CMessageResult@VSTGUI@@PAVCBaseObject@5@PBD@Z) C:\...\VST3 GUI take3\vst3_call.obj
Error 38 error LNK2019: unresolved external symbol "public: virtual __thiscall Steinberg::Vst::VSTGUIEditor::~VSTGUIEditor(void)" (??1VSTGUIEditor@Vst@Steinberg@@UAE@XZ) referenced in function "public: virtual __thiscall Steinberg::Vst::myclass::~myclass(void)" (??1myclass@Vst@Steinberg@@UAE@XZ) C:\...\VST3 GUI take3\vst3_call.obj
Error 39 error LNK1120: 18 unresolved externals C:\...\VST3 GUI take3.exe
Last edited on Dec 11, 2011 at 10:54pm UTC
Dec 11, 2011 at 10:45pm UTC
Are you sure the VST3 link library has been included in the linker line/properties?
Dec 11, 2011 at 11:06pm UTC
Thanks for the reply, yeah the base dll is included in the linker properties. Sorry I should have mentioned that elsewhere in the code I call other functions from the SDK without issue.
Dec 11, 2011 at 11:28pm UTC
Are there multiple VST3 libraries involved? ... I notice that the notify() / forget() / remember() / getNbReference() methods seem to be being resolved okay (or they aren't ever invoked)... *thinking out aloud* also wondering if your PLUGIN_API symbol is being defined correctly, but the beginEdit() / endEdit() routines aren't found either (there may be different name mangling if PLUGIN_API was not defined appropriately). Hmmmm...
If it was me, I'd probably check the VST3 .lib files to see what entrypoints _are_ defined (looking specifically for the ones you're missing, of course). The errors seem to be pointing toward a missing library (or incorrect compile) somewhere along the line... v(-_-)v. You are using the correct compiler for the link libraries I hope?
Last edited on Dec 11, 2011 at 11:31pm UTC
Dec 12, 2011 at 12:52pm UTC
Many thanks for your suggestions. There's just the one VST3 library, and I'm using Visual Studio 2010 to compile.
My original assumption was that there was a fault with my method of inheriting/overriding virtual functions - I have a lot of gaps in my c++ knowledge - but if my method is correct I'll be looking further at the .lib definitions as suggested. :) Any other ideas anybody?
Dec 12, 2011 at 8:09pm UTC
Sorry, me again <(^_^)...
... out of curiosity, is the namespace "Steinberg" (and the nested namespace "Vst") something you've added, or are they present within VSTGUIEditor.h?
(just wondering if you might have wrapped the #includes within a namespace Steinberg, which might result in the observed missing symbols...)
Dec 13, 2011 at 10:40am UTC
Haha thanks again mmay.
The Steinberg/Vst namespaces are part of the SDK, and so yes are present within VSTGUIEditor.h. It's a good thought, I had temporarily forgotten the namespaces were there :), but sadly no there doesn't appear to be any problems with wrapping #includes within the namespace definitions...
Dec 13, 2011 at 9:07pm UTC
Are there any sample programs provided with the SDK (that use that class)? ... do those link in your working environment? That would help to disprove any mismatch between your compiler or linker or 32 vs 64-bit or settings or library version etc.
If you #ifdef out that class... does the rest of the code link?
I do know how annoying it is to have a nice shiny SDK that just Doesn't Seem To Work... but I'm running out of ideas here (>_<).
Last edited on Dec 13, 2011 at 9:08pm UTC