vscode-clang-tidy
vscode-clang-tidy copied to clipboard
'ioStream' file not found
As the screenshots show clang-tidy does not find the MinGW header file iostream.
VS Code version: 1.44.2 OS: Windows 10, version 1903, build 18362.720 clang-tidy extension version: 0.4.1
clang/LLVM: version: 10.0 InstalledDir: C:\LLVM\bin
MinGW: version: x86_64-8.1.0-posix-seh-rt_v6-rev0 InstalledDir: C:\MinGW\mingw64
settings.json:
"clang-tidy.executable": "C:\\LLVM\\bin\\clang-tidy",
"clang-tidy.lintOnSave": true,
"clang-tidy.checks": [
"cppcoreguidelines-*",
"clang-analyzer-*"
],
"clang-tidy.compilerArgs": [
"--target=x86_64-pc-windows-gnu"
],
As the PATH variable shows, according to this everything is set:
If I execute the same command vscode-clang-tidy is executing (shown in the OUTPUT window) in the cmd of Windows, no iostream error is shown:
C:\LLVM\bin\clang-tidy c:\Users\xx\Desktop\test\main.cpp --export-fixes=- --checks=cppcoreguidelines-*,clang-analyzer-*,clang-diagnostic-* --extra-arg=--target=x86_64-pc-windows-gnu
I can't reproduce this with gcc installed through scoop. I'm having internet issues at the moment, so I can't test further for another few days. Sorry for the wait.
I am also hitting this. I am using the compile_commands.json
produced by cmake. Settings are:
"clang-tidy.buildPath": "${workspaceFolder}/build",
"clang-tidy.checks": [
"readability-*",
"readability-braces-around-statements",
"modernize-*",
"performance-*",
"-modernize-use-trailing-return-type",
"-readability-uppercase-literal-suffix"
],
Ubuntu 20.04 Extension version: 0.5.1
$ clang-tidy --version
LLVM (http://llvm.org/):
LLVM version 10.0.0
Optimized build.
Default target: x86_64-pc-linux-gnu
Host CPU: znver2
@jackgerrits clang-tidy.buildPath
does not currently accept variables like ${workspaceFolder}
.
Have the same issue on Manjaro with default setup LLVM 10.0.0
adding this in settings.json
solved the issue for me
"clang-tidy.compilerArgsBefore": [
"-stdlib=libc++",
"-isystem",
"/opt/homebrew/opt/llvm/include/c++/v1"
]