Vscode "Unable to open [file]: Unable to read file" message when clicking on an error

Dimen picture Dimen · Mar 1, 2020 · Viewed 18.5k times · Source

I get this message when I click on a warning. This is a screenshot of the case. enter image description here

The error reads,

Unable to open 'warning.cpp': Unable to read file '/Users/dimen/code/C++/Users/dimen/code/C++/warning.cpp' (Error: Unable to resolve non-existing file '/Users/dimen/code/C++/Users/dimen/code/C++/warning.cpp').

My script is located in /Users/dimen/code/C++/warning.cpp so vscode reiterates the path for some reason.

I suspected that the linter setting must've been written erroneously but I'm not sure where I should edit. As some side notes,

  • Using Microsoft's C/C++ extension.
  • tasks.json have been customized so that all the builds go inside the build folder

Answer

NowRam picture NowRam · Jan 29, 2021

I was facing this issue also.

For resolving this issue, I closed the VSCode and again imported folder again as Path of folder got changed in mine conditions.

Hope this helps. Else not you can uninstall VSCode and then reinstall it.