C++ 纯虚函数

来源:百度知道 编辑:UC知道 时间:2024/06/16 23:36:40
程序编译通过,执行错误,其中一个纯虚类(VIP),派生出类A(ungradustu),A再派生B(formalcard),在A和B中定义纯虚函数,错误如下:
--------------------Configuration: library - Win32 Debug-----------
Linking...
VIP.obj : warning LNK4078: multiple ".CRT" sections found with different attributes (40301040)
libcpd.lib(ios.obj) : error LNK2005: "public: void __thiscall std::ios_base::clear(int,bool)" (?clear@ios_base@std@@QAEXH_N@Z) already defined in ungradu.obj
libcpd.lib(locale0.obj) : error LNK2005: "public: static unsigned int const std::ctype<char>::table_size" (?table_size@?$ctype@D@std@@2IB) already defined in mater.obj
libcpd.lib(locale.obj) : error LNK2005: "public: __thiscall std::_Locinfo::~_Locinfo(void)" (??1_Locinfo@std@@QAE@XZ) already defined in VIP.obj
libcpd.lib(locale.obj) : error LNK2005: "public: static class std::locale::id std::num_put<char,class std::ostreambuf_iterator<char,struct std::char_traits<char> > >::id&qu

这叫链接出错..不是执行出错吧...说真的这样贴错误提示很难明白

你试下crtl+alt+F7看看 因为错误有提到pdb这些文件 估计是要重新编译链接才行

贴代码看看

那几个函数没有实现:::

这个应该不是纯虚函数的问题,应该是哪个库冲突啦!