-1

For a project, I am being asked to create a VST using the Steinberg SDK, i'm using version 2.4.

The issue that I'm having is error:

cannot allocate an object of abstract type 'mySynth'.

When attempting to compile, the error brings me to this section of code:

    AudioEffect* createEffectInstance (audioMasterCallback audioMaster)
    {
            return new mySynth (audioMaster);
    }

I'm a beginner to both c++ and VST programming, I've had no issues compiling the sample AGain and ADelay, as well as the vstxSynth. This is the first attempt of my own, and its really confusing me, from looking at the sample code i cannot seem to find any reason as to why this shouldn't work.

any help would be greatly appreciated. As this is a major learning curve for me, i would appreciate if you could apply with a simplest explanations as possible.

Thankyou :)

billz
  • 44,644
  • 9
  • 83
  • 100
  • Is `mySynth` your own class or something from VST? – Code-Apprentice Nov 08 '12 at 22:39
  • my own class built from using again as a base –  Nov 09 '12 at 09:59
  • Then the error means that the base class declares some pure virtual functions which you have not implemented. You will need to find out which functions you need to implement in order to make your mySynth class concrete instead of abstract as it is now. – Code-Apprentice Nov 09 '12 at 20:32

2 Answers2

2

Without seeing the class mySynth code it is hard to say but this error is commonly encountered when you have a class containing a pure virtual function. Either that or you have derived from a base class with a pure virtual function and have failed to override it with a derived class implementation.

If you do not know what that means, look in your class (and sub classes) for functions declared like this

 virtual int my_function() = 0;

This kind of function is a pure virtual function and a class that has one is considered an abstract class and cannot be instantiated. In order to do so you would need to provide an implementation.

mathematician1975
  • 21,161
  • 6
  • 59
  • 101
  • http://dl.dropbox.com/u/21696319/mySynth.cpp http://dl.dropbox.com/u/21696319/mySynth.h I've added the two links to both my header and cpp. i shall also look at your suggestion now, thankyou. –  Nov 09 '12 at 09:55
0

Your processReplacing() method is not correctly overriding signature declared in the base class AudioEffect. The signature looks like this:

void processReplacing(float** inputs, float** outputs, VstInt32 sampleFrames);

Your override is using double, it should use float instead.

Nik Reiman
  • 39,067
  • 29
  • 104
  • 160