How to avoid errors in Vscode for putting header files in a separate directory than src

You need to put that folder’s path to the Include path. One way to do that is shown below. The screenshots are attached with each steps so that it(the process) would be more clear.

Step 1

Press Ctrl + Shift + P

This will open up a prompt having different options. You have to select the option saying Edit Configurations

s1

Step 2

After selecting Edit Configurations a page will open with different options. You have to scroll down and go the the option saying Include Path and just paste the path to your include folder there.

s2

Below is the picture after adding the include folder’s path into the Include Path option.

s3

Step 3

Now after adding the path to the include folder into the Include path field you can close this window and all the vscode errors that you mentioned will not be there anymore.

Leave a Comment