1. 程式人生 > >error:對‘vtable for new_sequence’未定義的引用 對‘typeinfo for num_sequence’未定義的引用

error:對‘vtable for new_sequence’未定義的引用 對‘typeinfo for num_sequence’未定義的引用

() 類繼承 rtu 方案 con ble error: white ons

在設計父類子類繼承關系中,經常會出現此類問題。

報錯原因:父類中的虛函數只有聲明,沒有定義。

解決方案 :

  1. 定義相關的虛函數的實現。

  2. 不實現了,直接搞成純虛函數留給後代實現。     virtual int getlength()const = 0;

error:對‘vtable for new_sequence’未定義的引用 對‘typeinfo for num_sequence’未定義的引用