为什么按照视频写还是报错
1>------ 已启动生成: 项目: ConsoleApplication1, 配置: Debug Win32 ------
1> main.cpp
1>c:\users\nohao\desktop\xuhanshu\shape.h(8): error C2011: “Shape”:“class”类型重定义
1> c:\users\nohao\desktop\xuhanshu\shape.h(8): note: 参见“Shape”的声明
1>c:\users\nohao\desktop\xuhanshu\main.cpp(8): error C2440: “初始化”: 无法从“Rect *”转换为“Shape *”
1> c:\users\nohao\desktop\xuhanshu\main.cpp(8): note: 与指向的类型无关;转换要求 reinterpret_cast、C 样式转换或函数样式转换
1>c:\users\nohao\desktop\xuhanshu\main.cpp(9): error C2440: “初始化”: 无法从“Circle *”转换为“Shape *”
1> c:\users\nohao\desktop\xuhanshu\main.cpp(9): note: 与指向的类型无关;转换要求 reinterpret_cast、C 样式转换或函数样式转换
1>c:\users\nohao\desktop\xuhanshu\main.cpp(10): error C2027: 使用了未定义类型“Shape”
1> c:\users\nohao\desktop\xuhanshu\shape.h(8): note: 参见“Shape”的声明
1>c:\users\nohao\desktop\xuhanshu\main.cpp(10): error C2227: “->calcArea”的左边必须指向类/结构/联合/泛型类型
1>c:\users\nohao\desktop\xuhanshu\main.cpp(11): error C2027: 使用了未定义类型“Shape”
1> c:\users\nohao\desktop\xuhanshu\shape.h(8): note: 参见“Shape”的声明
1>c:\users\nohao\desktop\xuhanshu\main.cpp(11): error C2227: “->calcArea”的左边必须指向类/结构/联合/泛型类型
1> Rect.cpp
1> 正在生成代码...
========== 生成: 成功 0 个,失败 1 个,最新 0 个,跳过 0 个 ==========






