开发者

How am I getting a linker error: Unresolved external symbol

开发者 https://www.devze.com 2023-02-18 00:45 出处:网络
This is in a Windows Console application, so I have no idea how this is happening at all. #include \"Library.h\"

This is in a Windows Console application, so I have no idea how this is happening at all.

#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;
}


Your declaration in the header file looks like this:

bool Poglathon(std::vector<std::string>& text,Player player);

Your attempt to define in the cpp file looks like this:

bool Poglathon(std::vector<std::string>& text,Player * player);

Change the declaration to take a Player * instead of a Player


Apparently the problem is that the declaration of the function (inside your header files) is like this:

bool Poglathon(std::vector<std::string>& text,Player player);

But you defined it like this:

bool Poglathon(std::vector<std::string>& text,Player *player)

Decide what you want and be consistent.

0

精彩评论

暂无评论...
验证码 换一张
取 消