Language: C++

#include<cstdio>
#include<cstdlib>
#include<cstring>
struct Node{
  int key;
  struct node *next;
  struct node *prev;
};

Node *nil;

Node* listsearch(int key){
  Node *cur = nil->next;
  while(cur != nil && cur->key != key){
    cur = cur->next;
  }
  return cur;
}

void init(void){
  nil = (Node *)malloc(sizeof(Node));
  nil->next = nil;
  nil->prev = nil;
}

void printList(){
  Node *cur = nil->next;
  int isf = 0;
  while(1){
    if(cur == nil) break;
    if(isf++ > 0) printf(" ");
    printf("%d",cur->key);
    cur = cur->next;
  }
  printf("\n");
}

void deleteNode(Node *t){
  if(t == nil) return;
  t->prev->next = t->next;
  t->next->prev = t->prev;
  free(t);
}

void deleteFirst(){
  deleteNode(nil->next);
}

void deleteLast(){
  deleteNode(nil->prev);
}

void deleteKey(int key){
  deleteNode(listSearch(key));
}

void insert(int key){
  Node *x = (Node *)malloc(sizeof(Node));
  x->key = key;
  x->next = nil->next;
  nil->next->prev = x;
  nil->next = x;
  x->prev = nil;
}

int main(){
  int key,n,i;
  int size=0;
  int np=0,nd=0;
  char com[20];

  scanf("%d",&n);
  init();
  for(i=0 ; i<n ; i++){
    scanf("%s%d",com,&key);
    if(com[0] == 'i'){
      insert(key);
      np++;
      size++;
    }
    else if(com[0] == 'd'){
      if(strlen(com) > 6){
        if(com[6] == 'F') deleteFirst();
        else if(com[6] == 'L') deleteLast();
      }
      else{
         deleteKey(key);
         nd++;
      }
      size--;
    }
  }
  printList();

  return 0;
}

Compiler output:
a.cc: In function 'Node* listsearch(int)':
a.cc:13:20: error: cannot convert 'node*' to 'Node*' in initialization
   13 |   Node *cur = nil->next;
      |               ~~~~~^~~~
      |                    |
      |                    node*
a.cc:6:10: note: class type 'node' is incomplete
    6 |   struct node *next;
      |          ^~~~
a.cc:15:16: error: cannot convert 'node*' to 'Node*' in assignment
   15 |     cur = cur->next;
      |           ~~~~~^~~~
      |                |
      |                node*
a.cc:6:10: note: class type 'node' is incomplete
    6 |   struct node *next;
      |          ^~~~
a.cc: In function 'void init()':
a.cc:22:15: error: cannot convert 'Node*' to 'node*' in assignment
   22 |   nil->next = nil;
      |               ^~~
      |               |
      |               Node*
a.cc:23:15: error: cannot convert 'Node*' to 'node*' in assignment
   23 |   nil->prev = nil;
      |               ^~~
      |               |
      |               Node*
a.cc: In function 'void printList()':
a.cc:27:20: error: cannot convert 'node*' to 'Node*' in initialization
   27 |   Node *cur = nil->next;
      |               ~~~~~^~~~
      |                    |
      |                    node*
a.cc:6:10: note: class type 'node' is incomplete
    6 |   struct node *next;
      |          ^~~~
a.cc:33:16: error: cannot convert 'node*' to 'Node*' in assignment
   33 |     cur = cur->next;
      |           ~~~~~^~~~
      |                |
      |                node*
a.cc:6:10: note: class type 'node' is incomplete
    6 |   struct node *next;
      |          ^~~~
a.cc: In function 'void deleteNode(Node*)':
a.cc:40:10: error: invalid use of incomplete type 'struct node'
   40 |   t->prev->next = t->next;
      |          ^~
a.cc:6:10: note: forward declaration of 'struct node'
    6 |   struct node *next;
      |          ^~~~
a.cc:41:10: error: invalid use of incomplete type 'struct node'
   41 |   t->next->prev = t->prev;
      |          ^~
a.cc:6:10: note: forward declaration of 'struct node'
    6 |   struct node *next;
      |          ^~~~
a.cc: In function 'void deleteFirst()':
a.cc:46:19: error: cannot convert 'node*' to 'Node*'
   46 |   deleteNode(nil->next);
      |              ~~~~~^~~~
      |                   |
      |                   node*
a.cc:38:23: note:   initializing argument 1 of 'void deleteNode(Node*)'
   38 | void deleteNode(Node *t){
      |                 ~~~~~~^
a.cc:6:10: note: class type 'node' is incomplete
    6 |   struct node *next;
      |          ^~~~
a.cc: In function 'void deleteLast()':
a.cc:50:19: error: cannot convert 'node*' to 'Node*'
   50 |   deleteNode(nil->prev);
      |              ~~~~~^~~~
      |                   |
      |                   node*
a.cc:38:23: note:   initializing argument 1 of 'void deleteNode(Node*)'
   38 | void deleteNode(Node *t){
      |                 ~~~~~~^
a.cc:6:10: note: class type 'node' is incomplete
    6 |   struct node *next;
      |          ^~~~
a.cc: In function 'void deleteKey(int)':
a.cc:54:14: error: 'listSearch' was not declared in this scope; did you mean 'listsearch'?
   54 |   deleteNode(listSearch(key));
      |              ^~~~~~~~~~
      |              listsearch
a.cc: In function 'void insert(int)':
a.cc:61:12: error: invalid use of incomplete type 'struct node'
   61 |   nil->next->prev = x;
      |            ^~
a.cc:6:10: note: forward declaration of 'struct node'
    6 |   struct node *next;
      |          ^~~~
a.cc:62:15: error: cannot convert 'Node*' to 'node*' in assignment
   62 |   nil->next = x;
      |               ^
      |               |
      |               Node*
a.cc:63:13: error: cannot convert 'Node*' to 'node*' in assignment
   63 |   x->prev = nil;
      |             ^~~
      |             |
      |             Node*