CPP类的问题编译出错求助

[复制链接]
查看11 | 回复1 | 2009-7-31 12:05:18 | 显示全部楼层 |阅读模式
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

回复

使用道具 举报

千问 | 2009-7-31 12:05:18 | 显示全部楼层
army.cpp---------short army::getcmd(int ofsx,int ofsy){return 0;}...
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行