Jump to content
  • Advertisement
Sign in to follow this  
XDaWNeDX

Unresolved external symbol linker error

This topic is 2579 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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:

Share this post


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

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.


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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!