包含了头文件和类声明但在cpp中class has no constructors

对于PlayerA和PlayerB的问题
修改了问题
这是LessonX.h

img

这是LessonX.cpp

img

我之前在.h和.cpp都包含了PlayerA和B的头文件和类的声明,但没有用
定义了构造函数如图,PlayerB也是一样的

img

你没有定义构造函数,加上构造函数即可。

你贴的两张图片是一样的。
没看到你PlayerA和PlayerB类的代码,错误提示是这两个类没有构造函数
既然你已经#include "PlayerA.h"和#include "PlayerB.h"了,下面的class Player1,class PlayerA,class PlayerB都不需要的,删掉