Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

undefined reference error in VScode Version 1.69.1

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

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

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..

>Solution :

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"); 
}
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading