cocos2d-x编译错误问题

时间:2023-11-28 19:26:44

在xcode中创建的cocos2d-x项目,然后添加了一个基类,里面有虚方法,编译时出错,错误如下:

Undefined symbols for architecture x86_64:
"typeinfo for BaseReader", referenced from:
typeinfo for MainPageReader in MainPageReader.o
"vtable for BaseReader", referenced from:
BaseReader::BaseReader() in BaseReader.o
BaseReader::BaseReader() in MainPageReader.o
NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

问题其实是出在,基类中有的虚方法没有重写