Unresolved external symbol linker error

Started by
1 comment, last by XDaWNeDX 12 years, 10 months ago
I get these...



1>GameMain.obj : error LNK2019: unresolved external symbol "public: void __thiscall CDraw::DrawUserStats(class CPlayerInfo)" ([email="?DrawUserStats@CDraw@@QAEXVCPlayerInfo@@@Z"]?DrawUserStats@CDraw@@QAEXVCPlayerInfo@@@Z[/email]) referenced in function "void __cdecl DisplayMap(class CPlayerInfo)" ([email="?DisplayMap@@YAXVCPlayerInfo@@@Z"]?DisplayMap@@YAXVCPlayerInfo@@@Z[/email])

1>GameMain.obj : error LNK2019: unresolved external symbol "public: void __thiscall CDraw::DrawSkills(class CPlayerInfo,int)" ([email="?DrawSkills@CDraw@@QAEXVCPlayerInfo@@H@Z"]?DrawSkills@CDraw@@QAEXVCPlayerInfo@@H@Z[/email]) referenced in function "void __cdecl BattleSequence(class CMonsterInfo,class CPlayerInfo)" ([email="?BattleSequence@@YAXVCMonsterInfo@@VCPlayerInfo@@@Z"]?BattleSequence@@YAXVCMonsterInfo@@VCPlayerInfo@@@Z[/email])

1>GameMain.obj : error LNK2019: unresolved external symbol "public: void __thiscall CDraw::DrawMonsterStats(class CMonsterInfo)" ([email="?DrawMonsterStats@CDraw@@QAEXVCMonsterInfo@@@Z"]?DrawMonsterStats@CDraw@@QAEXVCMonsterInfo@@@Z[/email]) referenced in function "void __cdecl BattleSequence(class CMonsterInfo,class CPlayerInfo)" ([email="?BattleSequence@@YAXVCMonsterInfo@@VCPlayerInfo@@@Z"]?BattleSequence@@YAXVCMonsterInfo@@VCPlayerInfo@@@Z[/email])




Draw.cpp

#include "Draw.h"
#include <iostream>
using namespace std;

CDraw::CDraw(void)
{
}


CDraw::~CDraw(void)
{
}

void DrawSkill(CPlayerSkills PlayerSkill, int j, int selection, int i){
if (PlayerSkill.m_SkillLevel){
cout<<j<<". "<<PlayerSkill.m_SkillName<<" LVL("<<PlayerSkill.m_SkillLevel<<")";
}
else if ((PlayerSkill.m_SkillLevel) && (selection == i)) {
cout<<"[ "<<j<<". "<<PlayerSkill.m_SkillName<<" LVL("<<PlayerSkill.m_SkillLevel<<") ]";
}
}

void DrawSkills(CPlayerInfo Player, int selection){

DrawSkill(Player.m_PlayerSkillFire,1,selection,0);
DrawSkill(Player.m_PlayerSkillThunder,2,selection,1);
DrawSkill(Player.m_PlayerSkillWater,3,selection,2);

}

void DrawUserStats(CPlayerInfo Player){
cout<<"\n User Stats:\n";
cout<<" EXPERIENCE: "<<Player.m_PlayerExp<<"\n";
cout <<"HP: "<<Player.m_PlayerHP;
cout <<" MP: "<<Player.m_PlayerMP;
cout <<" SP: "<<Player.m_PlayerSP;
cout <<" STP: "<<Player.m_PlayerSTP<<"\n";
cout <<"STR: "<<Player.m_PlayerSTR;
cout <<" Luk: "<<Player.m_PlayerLuk;
cout <<" ATT: "<<Player.m_PlayerAtt;
cout <<" Avoid: "<<Player.m_PlayerAvoid<<"\n";
cout <<"DEX: "<<Player.m_PlayerDEX;
cout <<" Int: "<<Player.m_PlayerInt;
cout <<" DEF: "<<Player.m_PlayerDef;
cout <<" Accuracy: "<<Player.m_PlayerAcc;
}

void DrawMonsterStats(CMonsterInfo Monster){
cout<<"\n Enemy Stats:\n";
cout<<" Level: "<<Monster.m_MonsterLevel;
cout <<" EXPERIENCE: "<<Monster.m_MonsterEXP<<"\n";
cout <<"HP: "<<Monster.m_MonsterHp;
cout <<" ATT: "<<Monster.m_MonsterAtt;
cout <<" Acc: "<<Monster.m_MonsterAcc<<"\n";
cout <<"MP: "<<Monster.m_MonsterMp;
cout <<" DEF: "<<Monster.m_MonsterDef;
cout <<" Avoid: "<<Monster.m_MonsterAvoid<<"\n";

}


draw.h

#pragma once
#include "PlayerInfo.h"
#include "MonsterInfo.h"
class CDraw
{
public:
CDraw(void);
~CDraw(void);
void DrawSkill(CPlayerSkills PlayerSkill, int j, int selection, int i);
void DrawSkills(CPlayerInfo Player, int selection);
void DrawUserStats(CPlayerInfo Player);
void DrawMonsterStats(CMonsterInfo Monster);
};



WHAT THE HELL IS HAPPENING? D:
I am a sesquipidalian.

Go not where the path leads, but rather walk somewhere new and leave a trail.
Advertisement
the scopes don't match, it's bit confusing, cause your code didn't maintain indentation... but basically the compiler is looking for a definition or decleration of

CDraw::DrawUserStats

but you have it defined as

DrawUserStats

in you're cpp file add, "CDraw::" to the beginning of your function, to tell it that that function is in the scope of the class CDraw.
[ dev journal ]
[ current projects' videos ]
[ Zolo Project ]
I'm not mean, I just like to get to the point.

the scopes don't match, it's bit confusing, cause your code didn't maintain indentation... but basically the compiler is looking for a definition or decleration of

CDraw::DrawUserStats

but you have it defined as

DrawUserStats

in you're cpp file add, "CDraw::" to the beginning of your function, to tell it that that function is in the scope of the class CDraw.


OH. MY. GOD.

IM AN IDIOT. I can't believe I forgot that. Then I got so pissy about this thing, and bleh...
I am a sesquipidalian.

Go not where the path leads, but rather walk somewhere new and leave a trail.

This topic is closed to new replies.

Advertisement