My program won't compile correctly. It gives undefined errors. Can someone help me solving that? It says
C:\Users\Milan_2\AppData\Local\Temp\ccQt3lVs.o In function 'orderOnConveyer': 90 C:\Users\Milan_2\Desktop\Untitled2.c undefined reference to 'insert'
C:\Users\Milan_2\AppData\Local\Temp\ccQt3lVs.o In function 'WTandTAT': 115 C:\Users\Milan_2\Desktop\Untitled2.c undefined reference to 'isEmpty' C:\Users\Milan_2\AppData\Local\Temp\ccQt3lVs.o In function 'main':
#include <stdio.h>
#include <conio.h>
#include <malloc.h>
#define MAX1 30
#define MAX2 30
#define TRUE 1
#define FALSE 0
struct cake{
    char cake;
    int preperation_time;
    int baking_time;
    int waiting_time;
    int turnaround_time;
};
struct Queue{
    int front;
    int rear;
    int count;
    struct cake items[MAX1];
};
struct Stack{
    int top;
    struct cake items[MAX2];
};
struct cake ChocolateCake();
struct cake SpongeCake();
struct cake MeringueCake();
struct cake RedVelvetCake();
void orderOnConveyer(struct Queue *, int);
void WTandTAT(struct Queue *,struct Queue *, int);
int longestBakingTime(struct Queue *q);
void orderOnStorageConveyer(struct Queue *, struct Stack *);
void averageWaitingTime_and_averageTurnaroundTime(struct Queue *, struct Queue *);
void init(struct Queue *);
int isFull(struct Queue *);
void insert(struct Queue *, struct cake);
void push(struct Stack *, struct cake);
struct cake pop(struct Stack *);
struct cake ChocolateCake(){
     struct cake c;
     c.cake='C';
     c.preperation_time=25;        
     c.baking_time=40;             
     c.waiting_time=0;
     c.turnaround_time=0;
     return c;
}
struct cake SpongeCake(){
     struct cake c;
     c.cake='S';
     c.preperation_time=30;
     c.baking_time=20;           
     c.waiting_time=0;
     c.turnaround_time=0;
     return c;
}
struct cake MeringueCake(){
     struct cake c;
     c.cake='M';
     c.preperation_time=45;
     c.baking_time=75;           
     c.waiting_time=0;
     c.turnaround_time=0;
     return c;
}
struct cake RedVelvetCake(){
     struct cake c;
     c.cake='R';
     c.preperation_time=60;
     c.baking_time=30;          
     c.waiting_time=0;
     c.turnaround_time=0;
     return c;
}
void orderOnConveyer(struct Queue *q, int minute){
     int i;
     printf("\n\n\n\n----------Conveyer Order----------\n\n\n");
     for(i=1;i<=minute;i++){
         if(i%25==0){
            printf("\nChocolate Cake");
            insert(q, ChocolateCake());
         }
         if(i%30==0){
            printf("\nSponge Cake");
            insert(q, SpongeCake());
         }
         if(i%45==0){
            printf("\nMeringue Cake");
            insert(q, MeringueCake());
         }
         if(i%60==0){
            printf("\nRedVelvet Cake");
            insert(q, RedVelvetCake());
         }
     }    
}
void WTandTAT(struct Queue *q, struct Queue *q1, int minute){
         struct cake temp;
         int i,temp1=0,temp2=0,temp3=0,temp4=0;
         printf("\n\n\n------- Waiting Time & Turnaround Time for each cake -------\n\n");
         printf("Cake\tWaiting Time\tTurnaround Time");
         while(!isEmpty(q)){
         if(temp.preperation_time==25){
              for( i=temp.preperation_time+temp1;i<minute;i++){
                  temp.waiting_time++;   
         }
              temp1=temp1+temp.preperation_time;
              temp.turnaround_time=temp.baking_time+temp.waiting_time;
              insert(q1, temp);   
         }
         else if(temp.preperation_time==30){
              for( i=temp.preperation_time+temp2;i<minute;i++){
                  temp.waiting_time++;    
              }
              temp2=temp2+temp.preperation_time;
              temp.turnaround_time=temp.baking_time+temp.waiting_time;
              insert(q1, temp);
         }
         else if(temp.preperation_time==45){
              for( i=temp.preperation_time+temp3;i<minute;i++){
                  temp.waiting_time++; 
              }
              temp3=temp3+temp.preperation_time;
              temp.turnaround_time=temp.baking_time+temp.waiting_time;
              insert(q1, temp);
         }
         else if(temp.preperation_time==60){
              for( i=temp.preperation_time+temp4;i<minute;i++){
                  temp.waiting_time++;  
          }
              temp4=temp4+temp.preperation_time;
              temp.turnaround_time=temp.baking_time+temp.waiting_time;
              insert(q1, temp);
         }
         }
}
void averageWaitingTime_and_averageTurnaroundTime(struct Queue *q, struct Queue *q1)
 {
      struct cake temp;
      int Total_waiting_time=0, count=q->count, Total_turnaround_time=0;
      float avgWT=0, avgTAT=0;
      while(!isEmpty(q)){
            Total_waiting_time=Total_waiting_time+temp.waiting_time;
            avgWT=(Total_waiting_time/count);
            Total_turnaround_time=Total_turnaround_time+temp.turnaround_time;
            avgTAT=(Total_turnaround_time/count);
            insert(q1,temp);
      }
      printf("\n\n------------------------------------------------------------------------");        
      printf("\n\nAvarage Waiting Time =  %f min",avgWT);
      printf("\n\nAvarage Turnaround Time =  %f min",avgTAT);            
}
main(){
     struct Queue q;
     struct Queue q1;
     struct Stack s;
     struct cake temp;
     int minute, i=0;
     s.top=-1; 
     init(&q); 
     init(&q1);
     printf("*******************Welcome Bakery Simulation*******************");
     printf("\n\t\t       Author : Milan Udayanga( )");
     printf("\n--------------------------------------------------------------------------------");
     printf("\n\nEnter the duration(minute) for check the process in the bakery:");
     scanf("%d",&minute);
    orderOnConveyer(&q, minute);
    WTandTAT(&q, &q1, minute);
    while(!isEmpty(&q1)){
        printf("\n%c\t%d\t\t%d", temp.cake, temp.waiting_time, temp.turnaround_time);
        insert(&q,temp);
   }
    averageWaitingTime_and_averageTurnaroundTime(&q, &q1);
    orderOnStorageConveyer(&q1, &s);
    while(!isEmpty(&s)){
        temp= pop(&s);
        printf("\n%c",temp.cake);
   }
    getch();
    return 0;
}
 
     
    