【问题标题】:Include error in visual studio code while compiling a C++ program编译 C++ 程序时在 Visual Studio 代码中包含错误
【发布时间】:2019-07-23 07:07:28
【问题描述】:

我正在使用 Visual Studio 代码进行 C++ 编程。每当我运行我的程序时,它都会给我以下错误:

包括检测到的错误。

请更新您的 includePath。

此翻译单元禁用曲线 (/home/yash_j1301/Documents/GitHub/C++ Workspace/yash1.cpp)。

我使用的是 Ubuntu 19.04 Disco Dingo,并且对 c++ 编程非常陌生。在互联网上,我找到了一些解决方案,例如提供头文件的路径,我做到了,但它仍然显示错误。我已经安装并更新了所有相同的 c/c++ 扩展。

知道哪里出错了吗?我已经附上了错误的屏幕截图。

这是我的 c_cpp_properties.json 文件代码:

{
    "configurations": [
        {
            "name": "Linux",
            "includePath": [
              "${workspaceFolder}/**",
              "/home/yash_j1301/TC/INCLUDE/**"
            ],
            "defines": [],
            "compilerPath": "/usr/bin/gcc",
            "cStandard": "c11",
            "cppStandard": "c++17",
            "intelliSenseMode": "clang-x64"
        },
        {
            "name": "conf1",
            "includePath": [
                "/home/yash_j1301/TC/CLASSLIB/INCLUDE/",
                "/home/yash_j1301/TC/INCLUDE/SYS/",
                "/home/yash_j1301/TC/INCLUDE/"
            ],
            "defines": [],
            "compilerPath": "/usr/bin/gcc",
            "cStandard": "c11",
            "cppStandard": "c++17",
            "intelliSenseMode": "clang-x64"
        }
    ],
    "version": 4
}

知道我错过了什么吗?

【问题讨论】:

    标签: visual-studio-code c++


    【解决方案1】:

    这些是你可以做的事情:

    1. 检查是否安装了 c/c++ 扩展。

    1. 检查是否安装了mingw-w64 (http://www.mingw-w64.org/doku.php)
    2. 右键单击导入语句并将其添加到路径:

    这里是所有细节:https://code.visualstudio.com/docs/languages/cpp

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-11-02
      • 1970-01-01
      • 2011-06-18
      • 1970-01-01
      • 2016-10-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多