C程序错误

来源:百度知道 编辑:UC知道 时间:2024/05/15 16:23:28
--------------------Configuration: 栈 - Win32 Debug--------------------
Linking...
栈.obj : error LNK2001: unresolved external symbol "void __cdecl match(int)" (?match@@YAXH@Z)
栈.obj : error LNK2001: unresolved external symbol "void __cdecl match(int)" (?match@@YAXH@Z)
栈.obj : error LNK2001: unresolved external symbol "void __cdecl term(void)" (?term@@YAXXZ)
Debug/栈.exe : fatal error LNK1120: 2 unresolved externals
执行 link.exe 时出错.

栈.exe - 1 error(s), 0 warning(s)

请问这大概是什么错误
void expr(SqStack &S)
{
void term(void);
void match(int);
term();
while(1)
if(lookahead=='+'){
match('+'); term(); putchar('+');
}
else if(lookahead=='-'){
match('-'); term(); putchar('-');
}
else break;
}
void term(SqStack &S)
{
int error(void);
void match(int);
if(isdigi

unresolved external symbol "void __cdecl match(int)
就是说连接器没找到match(int)这个函数

把函数声明放到外面
void term(void);
void match(int);

void expr(SqStack &S)
{

你最好可以把源程序贴出来看看~
函数参数的问题吧~

void term(void);
void match(int);
你的函数声明和后面的函数定义不一致。
比如term函数前面声明成无形参,而后面的定义却有形参SqStack &S。
再比如match函数前面声明的形参只有一个int型,而后面的定义却有两个形参SqStack &S,int t。