iOS "vtable for XXX", referenced from:
来源:互联网 发布:淘宝运营师培训 怎么考 编辑:程序博客网 时间:2024/06/06 13:10
问题描述:
"vtable for XXX", referenced from:
NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
原因:
1:是不是有纯虚函数没有实现
2:iOS C++中,纯虚函数中,要求非纯虚函数都必须得实现,检查是否有没有实现的虚函数.
错误代码如下:
class Foo { virtual void f(); virtual void s() = 0;};class Rice { Rice(){}; ~Rice(){}; virtual void f(){}; virtual void s(){};}int main(int argc, char **argv){ Rice rice; return(0);}
修改:
class Foo { virtual void f() = 0; virtual void s() = 0;};
或:
class Foo { virtual void f(){}; virtual void s() = 0;};
NOTE:
The ISO C++ Standard specifies that all virtual methods of a class that are not pure-virtual must be defined, but does not require any diagnostic for violations of this rule [class.virtual]/8. Based on this assumption, GCC will only emit the implicitly defined constructors, the assignment operator, the destructor and the virtual table of a class in the translation unit that defines its first such non-inline method.
Therefore, if you fail to define this particular method, the linker may complain about the lack of definitions for apparently unrelated symbols. Unfortunately, in order to improve this error message, it might be necessary to change the linker, and this can't always be done.
0 0
- iOS "vtable for XXX", referenced from:
- iOS--错误集锦--"vtable for __cxxabiv1::__si_class_type_info", referenced from:
- QtCreator 提示错误:Undefined symbols for architecture x86_64: "vtable for XXX", referenced from
- iOS:xxx referenced from
- cocos2d-x xcode提示错误:"vtable for XXX", referenced from 问题解决;
- "vtable for __cxxabiv1::__class_type_info", referenced from:
- "vtable for __cxxabiv1::__class_type_info", referenced from:
- c++ xcode提示错误:"vtable for UIPersonListView", referenced from:
- iOS:编译错误 "XXX", referenced from:
- iOS Dev (18) Undefined symbols for architecture xxx: "_main", referenced from ...
- "typeinfo for XXX::xxx", referenced from:typeinfo for xxx::xxx > in xx.o
- Undefined symbols for architecture i386: "xxx", referenced from:
- xxx referenced from: xxx in xxx.o
- "_OBJC_CLASS_$_CMMotionManager", referenced from:xxx
- undefined reference to `vtable for XXX '
- undefined reference to 'vtable for xxx'
- undefined reference to `vtable for batchsave::XXX'
- undefined reference to 'vtable for XXX class'
- linux系统管理命令之----高效使用top命令
- Dialer拨号定制功能
- 【二】线性表的链式存储结构
- 【1. 概述】开源入侵检测系统OSSEC详解
- 在qemu-system-arm模拟器启动initramfs根文件系统内核
- iOS "vtable for XXX", referenced from:
- 字符串截取 c++
- Android HttpClient基本使用方法
- hello, csdn
- 启动 Eclipse 弹出“Failed to load the JNI shared library jvm.dll”错误的解决方法
- Java的不定长参数和Python的不定长参数对比
- 读取生产订单 记入文档的货物移动明细
- 如何做好长尾词引流
- 20050519