我正在创建一个名为 SelectionPage 的类。这本质上是一组菜单。
但是,当我编译代码时,编译器给了我以下错误:
g++ C_Main.cpp C_HomePage.cpp C_SelectionPage.cpp C_MemberManagement.cpp -o Project
C_SelectionPage.cpp:9:104: error: expected initializer before ‘SelectionPage’
make: *** [Project] Error 1
这是 C_SelectionPage.cpp 的前几行:
#include "H_SelectionPage.h"
//Constructor for the SelectionPage class
//It assigns "managing" which decides if the user
//is a manager or not.
SelectionPage::SelectionPage(
int newPoints,
string newManager,
string newLoginName,
string MemberFile)
SelectionPage(
int newPoints,
string newManager,
string newLoginName,
string MemberFile)
{
points = newPoints;
manager = newManager;
loginName = newLoginName;
flatMemberList.clear();
//Create Object Governing Flat Members.
memberList = MemberManagement temp(MemberFile);
}
这是头文件中构造函数的声明:
SelectionPage(
int newPoints,
string newManager,
string newLoginName,
string MemberFile);
有人可以向我解释为什么我收到错误吗?
提前致谢。