can't find linker symbol for virtual table for 「function」.

程序在運行過程當中出現下列警告:函數

can't find linker symbol for virtual table for "xxx".table

xxx爲函數名,經查驗,文件中派生類已經實現其父類的虛函數,可是還出現這種狀況,後來發現,程序

是在父類中將虛函數定義爲了protected,而在派生類中倒是public,所以在調用的時候是在父類中tab

是找不到該函數的。將父類的虛函數聲明改成public就能夠了。文件

相關文章
相關標籤/搜索