#include errors detected in vscode

后端 未结 11 1010
名媛妹妹
名媛妹妹 2020-12-09 01:00

I am using Visual Studio Code in my C++ project. I installed Microsoft C/C++ Extension for VS Code. I got the following error:

#include error

相关标签:
11条回答
  • 2020-12-09 01:45

    Tried these solutions and many others over 1 hour. Ended up with closing VS Code and opening it again. That's simple.

    0 讨论(0)
  • 2020-12-09 01:45
    • Left mouse click on the bulb of error line
    • Click Edit Include path
    • Then this window popup

    • Just set Compiler path
    0 讨论(0)
  • 2020-12-09 01:50

    In my case I did not need to close the whole VS-Code, closing the opened file (and sometimes even saving it) solved the issue.

    0 讨论(0)
  • 2020-12-09 01:52

    I ended up here after struggling for a while, but actually what I was missing was just:

    If a #include file or one of its dependencies cannot be found, you can also click on the red squiggles under the include statements to view suggestions for how to update your configuration.

    source: https://code.visualstudio.com/docs/languages/cpp#_intellisense

    0 讨论(0)
  • 2020-12-09 01:53

    For Windows:

    1. Please add this directory to your environment variable(Path):

    C:\mingw-w64\x86_64-8.1.0-win32-seh-rt_v6-rev0\mingw64\bin\

    1. For Include errors detected, mention the path of your include folder into

    "includePath": [ "C:/mingw-w64/x86_64-8.1.0-win32-seh-rt_v6-rev0/mingw64/include/" ]

    , as this is the path from where the compiler fetches the library to be included in your program.

    0 讨论(0)
提交回复
热议问题