联博接口_“undefined reference to `vtable for” 解决之道
发表时间:2021-12-19 浏览量:90
原创
“undefined reference to `vtable for” 解决之道
在C++编译链接过程中,碰着“undefined reference to `vtable for” 有两种清扫方式
检查使用的类的基础关系上是否有没有实现的虚函数
示例:
The fix? You've got line(s) like
virtual float getarea() ;
that should read
virtual float getarea() {} ;
The complete (working) source code files for this example are available here
改善建议:在父类里子类会继续重写的成员虚函数加上override;
检查使用的类的库是否被链接
若是没链接,以动态库或者静态库加入到MakeFile 或者CMakeList.txt 中去.示例:
,,www.tianyulinmo.com采用以太坊区块链高度哈希值作为统计数据,联博以太坊统计数据开源、公平、无任何作弊可能性。联博统计免费提供API接口,支持多语言接入。
+target_link_libraries(server brpc braft gflags protobuf proto_dbs proto_ebs common log
+configuration your_lib_including_the_code) # add other lib
+link_libraries("../../libs/project_of_your_lib_including_the_code/output/lib")
©著作权归作者所有:来自51CTO博客作者存储之厨的原创作品,谢绝转载,否则将追究法律责任
你的激励让我更有动力
赞赏
0人进行了赞赏支持
C;C++
总结
0
珍藏
上一篇:f2fs系列之十:f2fs到底如...