
fatal error LNK1120: 1 unresolved externals怎么解决?
求指导,头插法建立链表,链接时出了错误,显示:LIBCD.lib(wincrt0.obj):errorLNK2001:unresolvedexternalsymbol_W...
求指导,头插法建立链表,链接时出了错误,显示:
LIBCD.lib(wincrt0.obj) : error LNK2001: unresolved external symbol _WinMain@16
Debug/study.exe : fatal error LNK1120: 1 unresolved externals
怎么回事。。
#include <malloc.h>
#include <stdio.h>
typedef char Elemtype;
typedef struct Lnode
{
Elemtype data;
struct Lnode *next;
}Lnode,*Linklist;
Lnode *creatlink (void) //头插法建立链表
{
Lnode *head,*t;
char ch;
head=(Lnode *)malloc(sizeof(Lnode));
t=(Lnode *)malloc(sizeof(Lnode));
head=t;
t->next=NULL;
while ((ch = getchar()) != '$')
{
t=(Lnode*)malloc(sizeof(Lnode));
t->next=head->next;
head=t;
}
return (head);
}
main()
{
Lnode *head,*t;
printf("头插入法建立链表");
printf("输入字符串");
head=creatlink();
t=head->next;
for(;t!=NULL;t=t->next) //输出链表
{
printf("%c",t->data);
}
} 展开
LIBCD.lib(wincrt0.obj) : error LNK2001: unresolved external symbol _WinMain@16
Debug/study.exe : fatal error LNK1120: 1 unresolved externals
怎么回事。。
#include <malloc.h>
#include <stdio.h>
typedef char Elemtype;
typedef struct Lnode
{
Elemtype data;
struct Lnode *next;
}Lnode,*Linklist;
Lnode *creatlink (void) //头插法建立链表
{
Lnode *head,*t;
char ch;
head=(Lnode *)malloc(sizeof(Lnode));
t=(Lnode *)malloc(sizeof(Lnode));
head=t;
t->next=NULL;
while ((ch = getchar()) != '$')
{
t=(Lnode*)malloc(sizeof(Lnode));
t->next=head->next;
head=t;
}
return (head);
}
main()
{
Lnode *head,*t;
printf("头插入法建立链表");
printf("输入字符串");
head=creatlink();
t=head->next;
for(;t!=NULL;t=t->next) //输出链表
{
printf("%c",t->data);
}
} 展开
1个回答
展开全部
工程->设置->连接中最下面的那个框下面的有个Windows改成console
找不到就在重新再新建过,工程选console的,这上面只是一种可能性
找不到就在重新再新建过,工程选console的,这上面只是一种可能性
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询