0

I am new to C++. I have downloaded this project and when I try to run it I get:

Severity    Code    Description Project File    Line    Suppression State
Error   C2695   'TFruityGain::Idle': overriding virtual function differs from 'TCPPFruityPlug::Idle' only by calling convention FruityGain_VC   c:source\c\fruitygain_vc\gain.h 38  

C++ Class:

class TFruityGain : public TCPPFruityPlug {
    private:
    public:
    virtual void _stdcall Idle();

};

class TCPPFruityPlug : public TFruityPlug {
    // some audio properties
    TAudioRenderer AudioRenderer;

    // temp buffer
    PWAV32FM ProcessTempBuffer;
    int MaxProcessLength;

    float PitchMul;
    TFruityPlugHost *PlugHost;

    virtual void Idle();
};
Remy Lebeau
  • 555,201
  • 31
  • 458
  • 770
Dev
  • 1,780
  • 3
  • 18
  • 46
  • 1
    Remove the `virtual void Idle();` line from `TCPPFruityPlug` entirely. That line declares a logically separate *new* virtual method. I assume you instead want to override `TFruityGain::Idle`, in which case you don't need anything in `TCPPFruityPlug`'s class definition because C++ doesn't require explicit `override` (though you should use it: https://en.cppreference.com/w/cpp/language/override ) – Dai Dec 30 '20 at 19:02
  • I think you need to either add or remove `_stdcall` from one of the functions in `TFruityGain` and `TCPPFruityPlug`. – David G Dec 30 '20 at 19:02
  • Please search for the error message first and in this case also the Cxxxx error code. – Ulrich Eckhardt Dec 30 '20 at 19:19
  • If you are using C++11 or later, you should change `virtual void _stdcall Idle();` to `void Idle() override;` in `TFruityGain` – Remy Lebeau Dec 30 '20 at 19:21
  • @UlrichEckhardt I did but I didn't understand, its a sample project, I was hoping it would come working, and if there were any issues it would be config stuff. – Dev Dec 30 '20 at 19:23

1 Answers1

3

differs from 'TCPPFruityPlug::Idle' only by calling convention

This issue comes from the fact that you have:

virtual void _stdcall Idle();

and

virtual void Idle();

And when you override a function you want the same calling convention, see:

What is the meaning and usage of __stdcall?

0RR
  • 1,538
  • 10
  • 21