army.h
-----------
class army
{
public:
short getcmd(int,int);
}
army.cpp
---------
short getcmd(int ofsx,int ofsy)
{return 0;
}
battle.cpp:
-------------
army chujun[10];
army *hheer=chujun;
short mclick;
short boxy=5;
mclick=(*hheer+boxy)->getcmd(10,10);
编译连接时出错
battle.obj : error LNK2019: unresolved external symbol "public: short __thiscall battle::getcmd(int,int)" (?getcmd@battle@@QAEFHH@Z) referenced in function "int __cdecl getmouse(int,int)" (?getmouse@@YAHHH@Z)
D:\gamfe\chuhan\Debug\chuhan.exe : fatal error LNK1120: 1 unresolved externals