Home > database >  undefined reference error in VScode Version 1.69.1
undefined reference error in VScode Version 1.69.1

Time:08-30

Below is simple program where i have configured VSCode on Azure VM with all applicable extensions to run c program

Function reference at top for compiler

But when i try to compile i am getting below error Undefined reference error

Installed Extensions

Any hints or missing extensions will assist... if i define func() at top prior main() it works but would be interested to know how do i make it work the way i am trying too ..any hints will be appreciated..

CodePudding user response:

Place your entire void meow(void) function definition:

void meow(void) { 
    printf("meow\n"); 
}

outside of the main() function definition brackets { } like so:

int main(void) {
    ...
    ...
}

void meow(void) { 
    printf("meow\n"); 
}
  • Related