使用 VSTGUI 初始化 'AEffGUIEditor' 没有匹配的构造函数

no matching constructor for initialization of 'AEffGUIEditor' with VSTGUI

我使用 VST SDK 2.4 制作了一个插件。到目前为止,我一直在使用通用界面来控制插件,但现在我正在尝试使用 VSTGUI 库添加自定义界面。

我已经设置了编辑器文件并尝试使用与库一起打包的示例代码中概述的代码。我有点担心 OSX Yosemite 可能无法完全兼容,但在这个阶段我正在解决一些基本问题。

我想知道我是否做错了什么,或者我应该放弃在 OSX 10.10 中使用 VSTGUI 吗?

在编译时,出现以下错误: ./TutorialEditor.h:42:32: 错误:

no matching constructor for initialization of 'AEffGUIEditor'
    Editor (const void* ptr) : AEffGUIEditor (ptr) {}
                               ^              ~~~
vstsdk2.4/vstgui.sf/vstgui/aeffguieditor.h:51:7: note: candidate constructor
      (the implicit copy constructor) not viable: cannot convert argument of incomplete type
      'const void *' to 'const AEffGUIEditor'
class AEffGUIEditor : public AEffEditor
      ^
vstsdk2.4/vstgui.sf/vstgui/aeffguieditor.h:55:2: note: candidate constructor not viable: cannot
      convert argument of incomplete type 'const void *' to 'AudioEffect *'
        AEffGUIEditor (AudioEffect* effect);
    ^

我的 vst 插件构造函数中的初始化如下所示:

extern AEffGUIEditor* createEditor (AudioEffectX*);
setEditor (createEditor (this));

这是 TutorialEditor.cpp 代码:

#include "TutorialEditor.h"

AEffGUIEditor* createEditor (AudioEffectX* effect) {
    return new Editor (effect);
}

bool Editor::open (void* ptr) {
    CRect frameSize (0, 0, 300, 300);
    frame = new CFrame (frameSize, ptr, this);
    return true;
}
void Editor::close () {
    delete frame;
    frame = 0;
}

这是 TutorialEditor.h 代码:

#include "vstgui.sf/vstgui/aeffguieditor.h"

class Editor : public AEffGUIEditor {
public:
    Editor (void* ptr) : AEffGUIEditor (ptr) {}
    bool open (void* ptr);
    void close ();
};

编译器不会自动将 void* 转换为 AudioEffect*

你可以通过写

来手动投射它
Editor (void* ptr) : AEffGUIEditor ((AudioEffect*)ptr) {}

但理想情况下,在这种情况下您应该完全避免使用 void*。

尝试替换

Editor (void* ptr) : AEffGUIEditor (ptr) {} 

来自

Editor (AudioEffect* ptr) : AEffGUIEditor (ptr) {}

如果可能的话。

丢失的类型信息越少越好。