簡體   English   中英

編譯C ++程序時在Visual Studio代碼中包含錯誤

[英]Include error in visual studio code while compiling a C++ program

我正在使用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
}

知道我錯過了什么嗎?

這些是您可以做的事情:

  1. 檢查是否已安裝c / c ++擴展名。

在此處輸入圖片說明

  1. 檢查是否已安裝mingw-w64( http://www.mingw-w64.org/doku.php
  2. 右鍵單擊import語句並將其添加到路徑: 在此處輸入圖片說明

以下是所有詳細信息: https : //code.visualstudio.com/docs/languages/cpp

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM