vscode-clang-tidy icon indicating copy to clipboard operation
vscode-clang-tidy copied to clipboard

'ioStream' file not found

Open DeadRabbits307 opened this issue 4 years ago • 5 comments

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"
    ],

03

As the PATH variable shows, according to this everything is set:

04

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

DeadRabbits307 avatar May 03 '20 09:05 DeadRabbits307

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.

notskm avatar May 21 '20 18:05 notskm

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 avatar Jun 05 '20 14:06 jackgerrits

@jackgerrits clang-tidy.buildPath does not currently accept variables like ${workspaceFolder}.

notskm avatar Jun 05 '20 19:06 notskm

Have the same issue on Manjaro with default setup LLVM 10.0.0

chocolacula avatar Jun 22 '20 16:06 chocolacula

adding this in settings.json solved the issue for me

  "clang-tidy.compilerArgsBefore": [
    "-stdlib=libc++",
    "-isystem",
    "/opt/homebrew/opt/llvm/include/c++/v1"
  ]

batunpc avatar Nov 04 '22 02:11 batunpc