这是在Windows控制台应用程序中,所以我根本不知道这是如何发生的。
#include "Library.h"
//poglathon.cpp
//starting region
bool Poglathon(std::vector<std::string>& text,Player *player){
using namespace std;
cout << "You see a town to one side and a path leading to a dark, murky forest in the other side." << endl;
int chosen = player->giveOptions(2,"Town","Path","","","");
return true;
}发布于 2011-03-22 03:06:04
您在头文件中的声明如下所示:
bool Poglathon(std::vector<std::string>& text,Player player);您尝试在cpp文件中定义的内容如下所示:
bool Poglathon(std::vector<std::string>& text,Player * player);更改声明以接受Player *而不是Player
发布于 2011-03-22 03:06:10
显然,问题是函数的声明(在你的头文件中)是这样的:
bool Poglathon(std::vector<std::string>& text,Player player);但你是这样定义的:
bool Poglathon(std::vector<std::string>& text,Player *player)决定你想要什么,并且保持一致。
https://stackoverflow.com/questions/5382242
复制相似问题