我在使用引用其他類的類時收到鏈接器錯誤。LNK2019使用無模板類
1>main.obj : error LNK2019: unresolved external symbol "public: __thiscall MovePattern::~MovePattern(void)" ([email protected]@[email protected]) referenced in function "public: __thiscall Enemy::Enemy(int,int,class MovePattern,char)" ([email protected]@[email protected]@@[email protected])
1>main.obj : error LNK2019: unresolved external symbol "public: __thiscall MovePattern::MovePattern(void)" ([email protected]@[email protected]) referenced in function "public: __thiscall Enemy::Enemy(int,int,class MovePattern,char)" ([email protected]@[email protected]@@[email protected])
這是從引用這個類:
class MovePattern{
public:
char next;
MovePattern();
MovePattern(const MovePattern &old){
p = old.p;
pi = 0;
next = p[0];
n = p[0];
}
MovePattern(char *pattern){
p = pattern;
pi = 0;
next = p[0];
n = p[0];
}
~MovePattern();
在這個類:
class Enemy{
public:
Enemy(int a, int b, MovePattern p,char c)
x = b;
y = a;
MovePattern pattern (p);
symbol = c;
目前,他們在同一.cpp文件中,並MovePattern高於敵人。
我不知道是怎麼回事就在這裏
的Visual C++ 2010速成一個空白的控制檯項目,我還沒有發現類似我的問題做任何事,任何幫助將將不勝感激。