"tomek" <ts**@op.pl> wrote:
Can anybody explain why can I not get rid of the above message
in the following class definition? [I am using Borland C++ Builder 5.0]
.... class BasicMidReader : public TMemoryStream
{
//some private date
public:
BasicMidReader(char* FN)
{// some code}
~BasicMidReader() {// some code}
};
I haven't used Borland C++, but just a guess:
"virtual function 'BasicMidReader::~BasicMidReader()' conflicts with base
class" sounds like TMemoryStream could have a virtual destructor, and you
haven't declared ~BasicMidReader() as virtual. If so, I would expect this to
be a warning rather than an error, since inherited virtual functions are
also virtual - even if they don't say so (but they should !)
(BTW: in general, all destructors should be virtual unless you are sure the
class will never be used as a base class - this even applies if the
destructor is empty (ie. there is nothing to explicitly delete)).
David F