I press Ctrl
and click #include<stdio.h>
, #include<bits/stdc++.h>
, #include<stdbool.h>
and so on, they all jump to different header files. For example:
#include<stdio.h>
–>/usr/incldue/stdio.h
#include<stdbool.h>
–>/usr/lib/llvm-14/lib/clang/14.0.0/include/stdbool.h
#include<bits/stdc++.h>
–>/usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h
example
enter image description here
Environment:
- WSL Ubuntu22.04
- VSCode
- use gcc
- clangd extension on (Default Configuration)
Here is my c_cpp_properties.json
:
{
"configurations": [
{
"name": "Linux",
"includePath": [
"${workspaceFolder}/**"
],
"defines": [],
"compilerPath": "/usr/bin/gcc",
"cStandard": "c11",
"cppStandard": "c++17"
}
],
"version": 4
}
I tried set default header in cpp_c_cpp_properties.json
or .clangd
as below, but they all failed.
"includePath": [
"${workspaceFolder}/**",
"/usr/lib/x86_64-linux-gnu/**",
],
It is a normal situation? It is my first time I write C++ in Linux. Usually I write C++ in Windows, I downloaded mingw-x64 and every time I click header files it all seemly jumped to the same location (all under the folder mingw
).
Exisfar is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.