天天看点

the vtable symbol may be undefined because the class is missing its key function

ld.lld: error: undefined symbol: vtable for Audio::AudioModule

>>> referenced by AudioModule.cpp:7 (AudioModule/src/AudioModule.cpp:7)

>>>               out/target/product/xxx/obj/SHARED_LIBRARIES/libaudiorouter_intermediates/AudioModule/src/AudioModule.o:(AudioModule::AudioModule(:AudioModule::ModuleType))

the vtable symbol may be undefined because the class is missing its key function (see https://lld.llvm.org/missingkeyfunction)

clang-9: error: linker command failed with exit code 1 (use -v to see invocation)

基类中的析构函数没有定义导致在派生类析构的时候虚函数表中找不到基类的析构函数的定义,从而导致了链接出错的问题。

实现父类中的析构函数即可解决问题

 ~AudioModule::AudioModule(){}

c++

继续阅读