Under Windows, it compiles without any trouble (at least, I don't think I changed anything). That name error can be fixed by moving the tmp->next = NULL statement above the if (*head == NULL) in...