各位大侠 unresolved external symbol 怎么解决 代码如下
我是用vc6.0编写的 调试的时候没有错误 组建的时候就出现问题了, 我是初学者 向各位大侠求救 以下是代码和错误
记录个人信息 代码:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int meun_select();
void enter();
void inputs();
struct addr *des_store(struct addr *i,struct addr *top);
struct addr *find(char *name);
void search();
void deleted();
void display(struct addr *);
struct addr
{
char name[30];
char street[40];
char city[20];
char state[3];
char tel[11];
struct addr *next; //pointer to next entry
};
void main()
{
char s[80],choice;
struct addr *info,*start,*last;
start=last=NULL;
for(;;)
switch(meun_select())
{
case 1:enter();
break;
case 2:deleted();
break;
case 3:search();
break;
case 4:exit(0);
}
}
int menu_select() //出错的函数
{
char s[80];
int c;
printf("1_Enter a name\n");
printf("2_Delet a record\n");
printf("3_Search\n");
printf("4_Quit\n");
do
{
printf("\nEnter your choice:");
gets(s);
c=atoi(s);
}while(c<1||c>4);
return(c);
}
void enter()
{
struct addr *info,*start,*head;
void inputs(char *,char *,int);
int n;
for(n=0;;n++)
{
info=(struct addr *)malloc(sizeof(addr));
if(info==NULL)
{
printf("\n out of memory");
return;
}
inputs("enter name:",info->name,30);
if(info->name[0]=='0')
break;
else
{
inputs("enter street:",info->street,40);
inputs("enter city:",info->city,20);
inputs("enter state:",info->state,3);
inputs("enter tel:",info->tel,11);
start=des_store(info,start);
if(n==0)
head=start;
}
}
}
void inputs(char *p1,char *s,int count)
{
char p[40];
do
{
printf("%s",p1);
gets(p);
if(strlen(p)>count)
printf("\n too long\n");
}while(strlen(p)>count);
strcpy(s,p);
}
struct addr *des_store(struct addr *i,struct addr *top)
{
struct addr *last;
if(!last)
{
last=i;
return(i);
}
else
{
top->next=i; //上一结点的指针项指向新结点;
i->next=NULL;
return(i);
}
}
struct addr *find(char *name)
{
struct addr *info,*head;
info=head;
while(info)
{
if(!strcmp(name,info->name))
return(info);
else
info=info->next;
}
return(info);
}
void search()
{
char name[40];
struct addr *info;
printf("enter name to find:");
gets(name);
if((info=find(name))==NULL)
printf("not found\n");
else
display(info); //显示找到的结点;
}
void deleted()
{
char s[80];
struct addr *p1,*p2,*info,*head;
printf("enter name");
gets(s);
info=find(s);
if(info!=NULL)
{
if(head==info)
{
head=info->next;
printf("deleted:%s\n",info->name);
free(info);
}
else
{
p1=head->next;
while(info!=p1)
{
p2=p1;
p1=p1->next;
}
p2->next=p1->next;
printf("deleted:%s\n",info->name);
free(info);
}
}
else
printf("%s not find!\n",info->name);
}
void display(struct addr *info)
{
printf("name: %s",info->name);
printf("street: %s",info->street);
printf("city: %s",info->city);
printf("state: %s",info->state);
printf("telphone: %s",info->tel);
}
错误显示:
Address.obj : error LNK2001: unresolved external symbol "int __cdecl meun_select(void)" (?meun_select@@YAHXZ)
Debug/Address.exe : fatal error LNK1120: 1 unresolved externals
执行 link.exe 时出错.