Vscode-cpptools: VSCode “'fileName' file not found"

Created on 16 Sep 2016  Â·  7Comments  Â·  Source: microsoft/vscode-cpptools

VSCode Version: 1.5.2
OS Version: 7

Steps to Reproduce:

  1. Set up VSCode, C/C++ package, g++, Clang and GDB hopefully correctly.
  2. Include some file.

See http://stackoverflow.com/questions/39512079/vscode-filename-not-found.
See https://github.com/Microsoft/vscode/issues/12151.
image

external

Most helpful comment

Via manually installing/uninstalling the various extensions you mentioned, I discovered that the C/C++ Clang extension is the cause of that error. Please visit their support site at https://github.com/mitaki28/vscode-clang/issues .

As far as I have seen, installing/uninstalling is safe to do with VS Code extensions, and whenever an extension is updated, it does an uninstall/install. The extensions settings should be saved at places like a .vscode folder that persist after an uninstall.

All 7 comments

Did you set the includePath to your system headers in c_cpp_properties.json?

Yes,
image
and it behaved differently before setting it, it was also needed to set the limitSymbolsToIncludedHeaders to false, because of the fact, that iostream and others don't have headers.

As far as I can tell, we do not show the "'fileName' file not found" error message with a red squiggle. Instead, we show a green squiggle with the text "Include file not found in include directory". Are you using a different extension? Also, can you get any other include path or header file to work this way? If there is a parse error in the c_cpp_properties.json, then our code may fail.

The green squiggle was shown before, but I fixed it, the red one is another story. I installed and enabled following extensions: C++ Intellisense, Shell, Terminal, C/C++ Snippets, C/C++ Clang, C/C++, Native Debug and Clang-Format. It is shown for any included file used as first one in the including file. I guess there isn't any parse error in c_cpp_properties.json.
image

Via manually installing/uninstalling the various extensions you mentioned, I discovered that the C/C++ Clang extension is the cause of that error. Please visit their support site at https://github.com/mitaki28/vscode-clang/issues .

As far as I have seen, installing/uninstalling is safe to do with VS Code extensions, and whenever an extension is updated, it does an uninstall/install. The extensions settings should be saved at places like a .vscode folder that persist after an uninstall.

Ok, thanks a lot!

Yes,
image
and it behaved differently before setting it, it was also needed to set the limitSymbolsToIncludedHeaders to false, because of the fact, that iostream and others don't have headers.

God, you solved my big problem!! Thanks.

Was this page helpful?
0 / 5 - 0 ratings