가능한 중복 :
What is an undefined reference/unresolved external symbol error and how do I fix it?되지 않은 외부 [생성자]
난 그냥 해결할 수없는 링커에 문제가 .. 이미 내가 생각할 수있는 무엇이든 시도 저는 Baseclass (Person)과 Derived Class (Dealer)를 가지고 있고 Dealer 클래스의 멤버 인 CardStack 클래스에서 Constructor를 호출하기를 원합니다. 솔직히 내가 생각할 수있는 모든게을 시도 Dealer.h
#ifndef DEALER_H
#define DEALER_H
#include "Person.h"
#include "Card.h"
#include "CardStack.h"
class Dealer : public Person
{
public:
Dealer(int stackcount);
virtual ~Dealer(void);
bool TakeCard(Card c);
bool Lost(void);
Card GiveCard(Card c);
protected:
void CheckLost(void);
CardStack m_GameStack;
};
#endif
Dealer.cpp
#include "Dealer.h"
Dealer::Dealer(int stackcount) : Person(), m_GameStack(stackcount)
{
};
Dealer::~Dealer(void)
{
};
bool Dealer::TakeCard(Card c)
{
if(!b_Lost || m_Hand.GetTotal() <= 17)
{
m_Hand.Take(c);
CheckLost();
return true;
}
return false;
};
void Dealer::CheckLost()
{
if (m_Hand.GetTotal() > 21)
{
b_Lost = true;
}
};
bool Dealer::Lost()
{
return b_Lost;
};
Person.h
#ifndef PERSON_H
#define PERSON_H
#include "Card.h"
#include "Hand.h"
class Person
{
public:
Person(void);
virtual ~Person(void);
virtual bool TakeCard(Card c);
virtual bool Lost(void);
protected:
virtual void CheckLost(void);
bool b_Lost;
Hand m_Hand;
};
#endif
: 여기
내 코드입니다 나는 생각할 수 없었다.1> Dealer.obj : 오류 LNK2019 : 실수는 무엇에서 ... 여기
는 Dealer.cpp 컴파일 출력은 확인되지 않은 외부 기호 "공개 : 가상 __thiscall 사람 :: ~ 사람 (무효) "(?? 1Person @@ UAE @ XZ) __unwindfunclet $ ?? 0Dealer @@ QAE @ H @ Z $ 01> Dealer.obj : 오류 LNK2001 : 해결되지 않은 외부 기호"public : virtual bool __thiscall Person :: TakeCard (클래스 카드) "(TakeCard @ Person @@ UAE_NVCard @@@ Z)
1> Dealer.obj : 오류 LNK2001 : 해결되지 않은 외부 기호"public : virtual bool __thiscall Person LNK2001 : 확인되지 않은 외부 기호 "protected : virtual void __thiscall Person :: CheckLost (void)"(? CheckLost (void)) "(Lost @ Person @@ UAE_NXZ)
1> Dealer.obj : Person @@ MAEXXZ)
링커가 무엇이 잘못되었는지 정확하게 알려줍니다. http://stackoverflow.com/questions/12573816/what-is-an-undefined-reference-unresolved-external-symbol-error-and-how-do-i-fix/12574407#12574407 –
을 참조하십시오. 나를 괴롭히는 파괴자? 미안하지만 중복 된 경우 많은 외부 기호 실수를 보았지만 아무 것도 일치하지 않습니다. ( – TheSentry
)하지만 저는 이미 Dealer :: Dealer()에서 가상 소멸자를 구현했습니다. 오 그걸 가지고 있습니다! :) – TheSentry