Adonai
Adonai

Reputation: 129

VsCode include Path errors are impossible to solve

The other answers i've seen proved to be ineffective.
I'm using c++ and it gives me error(red squiggle) when i include vector or string.
It tells me that my include path is not updated so i click on the lightbulb and try to edit intellisense configurations.
In this window there's an include path section, inside the box there's this string: ${workspaceFolder}/**.
So is this string the problem?
I've tried to put in this box the following path as well:
/usr/local/include but it doesn't change anything...
Please what should i change about this include path?? What is there supposed to be in it?

Upvotes: 4

Views: 3811

Answers (1)

ToCarbajal
ToCarbajal

Reputation: 574

Press Ctrl+Shift+P to open the Command Palette

Start typing "C/C++" and then choose Edit Configurations (UI) from the list of suggestions. This opens the C/C++ Configurations page. When you make changes here, VS Code writes them to a file called c_cpp_properties.json in the .vscode folder.

Find the Compiler path setting. VS Code will attempt to populate it with a default compiler based on what it finds on your system. For Clang on macOS, the path should look like this: /usr/bin/clang. The Compiler path setting is the most important setting in your configuration. The extension uses it to infer the path to the C++ standard library header files. When the extension knows where to find those files, it can provide lots of useful information to you as you write code. Set IntelliSense mode to ${default}, which on macOS is clang-x64. You only need to modify the Include path setting if your program includes header files that are not in your workspace or in the standard library path. On macOS, you must set the macFrameworkPath to point to the system header files. Visual Studio code places these settings in .vscode/c_cpp_properties.json.

Original documentation here!

Upvotes: 2

Related Questions