The project can be compiled and passed, but Vscode still has a wavy line prompt.

Preface

(1) When we use Vscode for development, the named file is successfully compiled, but Vscode still has a wavy line prompt.
(2) In fact, it is enough if the compilation is successful, but there will definitely be some patients with obsessive-compulsive disorder who insist on eliminating this error. Next I will explain how to eliminate this problem. The method is very simple

Insert image description here

text

(1) Press the keys ctrl+shift+p. You can enter the console, then enter C++ to find the edit configuration option.

Insert image description here

(2) Scroll down, find Advanced Settings, and click to expand.

Insert image description here

(3) Scroll down and find the compile command option

Insert image description here

(4) Copy the full path of compile_commands.json in the build path to this compilation command

Insert image description here

(5) Finished!

Guess you like

Origin blog.csdn.net/qq_63922192/article/details/132778148