[英]How am I getting a linker error: Unresolved external symbol
這在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;
}
您在頭文件中的聲明如下所示:
bool Poglathon(std::vector<std::string>& text,Player player);
您嘗試在cpp文件中進行定義的過程如下所示:
bool Poglathon(std::vector<std::string>& text,Player * player);
更改聲明以使用Player *
代替Player
顯然問題是函數的聲明(在頭文件中)如下所示:
bool Poglathon(std::vector<std::string>& text,Player player);
但是您是這樣定義的:
bool Poglathon(std::vector<std::string>& text,Player *player)
確定您想要什么並保持一致。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.