0

I'm really new to programming and have never seen this error. This is the full error:

/usr/bin/ld: /usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/crt1.o: in function _start': (.text+0x24): undefined reference to main' /usr/bin/ld: /tmp/introprog_telefonbuch-5eae26.o: in function bst_in_order_walk_node': /mnt/d/UNI/TU/IntroProg/C-Kurs/Übungen/moria98/introprog_telefonbuch.c:101: undefined reference to print_node' clang: error: linker command failed with exit code 1 (use -v to see invocation)

And I think this is the part of the Code that causes the error

void bst_in_order_walk_node(bst_node* node) {

        if(node) {
            
        bst_in_order_walk_node(node -> left);
        print_node(node);
        bst_in_order_walk_node(node -> right);
    }
}

Has anyone a possible fix?

Ompals
  • 1
  • 1
  • It looks like you don't have a function called `main`, and you don't have a function called `print_node`. `main` is required as the entry-point for C, and you're calling `print_node` in the snippet you include. – Paul Hankin Dec 14 '21 at 09:49
  • Ah I feel so dumb. I forgot to include my input file while compiling. Sorry for wasting your time! But the comment helped me! Have a nice day! – Ompals Dec 14 '21 at 09:55

0 Answers0