ld.lld: error: undefined symbol: typeinfo for <derived classname>
Why am I getting this error for the following code?
base::getABC
is never called directly. If I remove the definition of the virtual destructor I get an error about it.
class Base {
public:
virtual const std::shared_ptr<ABC> getABC() noexcept {
return nullptr;
}
virtual ~Base() {
}
};
class derived: public base {
const std::shared_ptr<ABC> getABC() noexcept override {
return abc_;
}
};
Aucun commentaire:
Enregistrer un commentaire