Sign in to follow this  
XDaWNeDX

Unresolved external symbol linker error

Recommended Posts

I get these...


[code]
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])
[/code]



Draw.cpp
[code]
#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";

}
[/code]

draw.h
[code]
#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);
};

[/code]

WHAT THE HELL IS HAPPENING? D:

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
[quote name='freeworld' timestamp='1307058099' post='4818905']
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.
[/quote]

OH. MY. GOD.

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

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this