How can I achieve deletion of StringWriter objects?

Hey everyone, I am using avr-g++ compiler on Windows for an AVR chip . I need to delete a StringWriter object created from a pointer to PacketWriter. As I define a destructor for StringWriter wether virtual or not, it leads to this error and similar ones. What could cause the 'undefined reference' error?
Undefined reference to 'operator delete(void*)'
Undefined reference to 'operator delete(void*)'
My PacketWriter.h:
class PacketWriter {
public:
virtual ~PacketWriter() {}
virtual uint8_t nextByte() = 0;
}
class PacketWriter {
public:
virtual ~PacketWriter() {}
virtual uint8_t nextByte() = 0;
}
StringWriter.h:
class StringWriter : public PacketWriter {
public:
StringWriter(const char* message);
virtual uint8_t nextByte();
}
class StringWriter : public PacketWriter {
public:
StringWriter(const char* message);
virtual uint8_t nextByte();
}
How can I achieve deletion of StringWriter objects in this context? @Middleware & OS
2 Replies
Marvee Amasi
Marvee Amasi7mo ago
I tried out C++ for this
electro_coco
electro_coco7mo ago
Delete api need a pointer and you are pointing to a void* which is null like what is actually being deleted? What memory is being pointed that it should delete Pass the object Plus what you do every day there is something new with you a new issue its like this forum is your personal gpt or something I don't see consistency in your issues or projects
Want results from more Discord servers?
Add your server