Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

#Include <stdio.h> problem (Visual Studio Code)

I am trying to do a project in C but I have problems with the string #include<stdio.h>, I tried several tutorials but none of them worked, my code:


#include <stdio.h>

int main () {

     int age;
     printf ("Enter age:");
     scanf ("% d", age);
     printf ("age is% d", age);
     return 0;

}

The problems are 2:

#Include errors were encountered. Update includePath.

Unable to open source file error code "stdio.h".

For this project I have created a folder, in which there is a folder called .dist and my Main.c file

(I have attached an image to be clearer)

enter image description here

Could anyone tell me how I can solve this problem?

like image 966
BLY_Tambu Avatar asked Aug 07 '26 13:08

BLY_Tambu


2 Answers

The error showed in the first picture is due to the incorrect setting of the IntelliSenseMode of the editor. I bet that you have installed gcc compiler on your computer and you should also set "gcc" on the IntelliSenseMode of the editor which, by default, has a wrong value that freakout when it reads "#include <stdio.h>".

like image 105
Miky-Bet Avatar answered Aug 10 '26 07:08

Miky-Bet


First, go to your C/C++ extension configuration and change your compiler path to gcc.exe

Then change Intellisense mode to windows-gcc-x64

Attached a screenshot for better understanding.

[VS Code

1

like image 44
Zareef Hasan Avatar answered Aug 10 '26 07:08

Zareef Hasan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!