Remove the warning:delete called on 'c' that is abstract but has non-virtual destructor

ftgf
Last edited on
Make the destructor virtual.
thanks firedraco but how do i do that? i m totally new to cpp. Please bear with me :(
All you have to do is add virtual in front of the destructor's declaration.
DOES that mean writing like a:: virtual ~a() in the 4th line ?
Last edited on
No. You have to go into the class definition and add the virtual there:

1
2
3
4
class theClass {
    //...
    virtual ~theClass();
};
yes the code is like this only
class theClass {
//...
virtual ~theClass();
};

But still gives warning ON CLANG COMPILER and NOT ON GCC
You could suppress the specific warning, or maybe the difference between the way virtual was handled in GCC and the original C.
Topic archived. No new replies allowed.