c - c未定义引用中的链接器错误
问题描述
我收到以下错误:
undefined reference to 'delete'
ld returned 1 exit status
我认为这意味着我错误地调用了该函数,但是所有 3 个函数都以相同的方式调用,并且只有 delete 函数给出了错误。我似乎无法弄清楚为什么
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
typedef struct node{
char pln[30];
char pfn[20];
int pid;
float pwt;
float phgnum;
struct node* next;
struct node* back;
}node;
typedef struct head{
float avghg;
float avgwt;
int pntcnt;
struct node *first;
struct node *rear;
}head;
void questions(head *header);
head* create_node(head *header);
head* delete(head *header);
int main(){
head *header;
int option;
do {
printf("Press 1 to input Paitients\n");
printf("Press 2 to Delete a Paitient\n");
printf("Press 3 to ask Questions:\n");
printf("Select Option: ");
scanf("%i", &option);
if (option == 1) {
header = create_node(header);
continue;
}
if (option == 2) {
header = delete(header);
continue;
}
if(option == 3){
void questions(header);
}
} while (option != 4);
return 0;
}
head* create_node(head *header){
}
head* delete(head *header){
}
void questions(head *header){
}
解决方案
推荐阅读
- karma-jasmine - Karma - 父组件规范文件中子组件的模拟属性
- android - 在 Google Play 商店上传 App Bundle (aab) 时收到以下警告
- excel - Vlookup 中的嵌套 Concat 函数不起作用,似乎找不到语法错误
- rest - SSL 证书与 JWT
- tensorflow - 在 Tensorflow Deeplab 上评估不同尺寸的图像
- python-2.7 - 如何将 Python 'None' 类型转换为 'NULL' 类型
- python - Jupyter - 合并 2 个具有相同 x 轴的图
- java - 如何获取我连接的路由器的 IP 地址
- reactjs - 从 API 中提取数据
- github - SSRS 与 GitHub 的集成