c语言xcode
#include<stdio.h>
#include<stdlib.h>
typedef struct LNode
{
int date;
struct LNode *next;
}LNode;
void list(LNode *head);
LNode *create(void);
int main()
{
LNode *head;
head=create();
list(head);
}
LNode *create(void)
{
LNode *head,*s,*r = NULL;
int n,x,i;
head=NULL;
printf("输入个数:");
scanf("%d",&n);
printf("输入%d个整数:",n);
for(i=0;i<=n;i++)
{
scanf("%d",&x);
s=(LNode *)malloc(sizeof(LNode));
s->date=x;
if(head==NULL)
{
head=s;
r=s;
r=head;
}
else
{
r->next=s;
r=s;
}
}
r->next=NULL;
return head;
}
Undefined symbols for architecture x86_64:
"_list", referenced from:
_main in main.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Showing All Messages
Undefined symbol: _list
搜索过有人说缺文件这类的,但是我这个不需要包含外部文件,刚开始学不知道错哪了
怎么让程序出结果正常运行
void list(LNode *head); 你的函数都没写。。。肯定会报错呀