'Visual studio Code doesn't recognize included directories with c++

I have just started developing c++ in Visual Studio Code and if I have a single file, for example main.cpp, the intellisense works fine and the project compiles but VsCode and g++ seem not to recognize other files in the same directory. I have a main.cpp file and a person.h file.

enter image description here

The configrations under c_cpp_properties.json list all the files and directory in the current one:

"includePath": [
                "${workspaceFolder}/**"
            ],

But the intellisense does not recognize the file and the compiler throws an error when compiling (g++).

Edit: I have done some more testing and it seems to start showing errors only after the project is built (Ctrl+Shift+B) with G++.

Am I doing something wrong?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source