Vscode C + + compilation can pass, but there is a red wavy line problem

Time:2020-9-15

1. Command + P, and then enter > C / C++
Vscode C + + compilation can pass, but there is a red wavy line problem
Select edit configuration (JSON)
Then a. Vscode folder will appear in the workspace with a configuration of the. JSON file
2. Open command line input

gcc -v -E -x c++ -

There will be the following information

`ignoring nonexistent directory "/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/c++/v1"
ignoring nonexistent directory "/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/local/include"
ignoring nonexistent directory "/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/Library/Frameworks"
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/include
 /Library/Developer/CommandLineTools/usr/include/c++/v1
 /Library/Developer/CommandLineTools/usr/lib/clang/10.0.1/include
 /Library/Developer/CommandLineTools/usr/include
 /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include
 /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/System/Library/Frameworks (framework directory)
End of search list.`

Copy the above path to the JSON file you just created
As shown in the figure below

{

"configurations": [
    {
        "name": "Mac",
        "includePath": [
            "${workspaceFolder}/**",
            "/usr/local/include/**",
            "/Library/Developer/CommandLineTools/usr/include/c++/v1/**",
            "/Library/Developer/CommandLineTools/usr/lib/clang/10.0.1/include/**",
            "/Library/Developer/CommandLineTools/usr/include/**",
            "/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/**",
            "/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/**"
        ],
        "defines": [],
        "macFrameworkPath": [],
        "compilerPath": "/usr/local/bin/gcc-7",
        "cStandard": "gnu11",
        "cppStandard": "gnu++14",
        "intelliSenseMode": "clang-x64"
    }
],
"version": 4

}

Be careful to add it at the back/**

Then the red wavy line doesn’t appear.