Vscode-cpptools: My vscode cannot recognize "cout" "endl" etc... Linux

Created on 24 May 2017  路  3Comments  路  Source: microsoft/vscode-cpptools

My Linux configuration (standard):

  • VS Code Version: 1.12.2
  • OS version: Linux Mint 18.1 64 bits
  • C++ plugin: ms-vscode.cpptools from microsoft (Version 0.11.1: May 19, 2017)
{
    "name": "Linux",
    "includePath": [
        "${workspaceRoot}",
        "/usr/include/c++/5",
        "/usr/local/include",
        "/usr/include"
    ],
    "defines": [],
    "browse": {
        "path": [
            "/usr/include/c++/5",
            "/usr/local/include",
            "/usr/include"
        ],
        "limitSymbolsToIncludedHeaders": true,
        "databaseFilename": ""
    }
}

Error message on the editor: "identifier 'cout' is undefined".
Although the program build normaly.

Most helpful comment

Can you try adding /usr/include/x86_64-linux-gnu and /usr/include/x86_64-linux-gnu/c++/5, assuming those folders exist? If that doesn't work, you can try opening the iostream and child headers to try to find the 1st one with #include files that can't be found.

All 3 comments

Can you try adding /usr/include/x86_64-linux-gnu and /usr/include/x86_64-linux-gnu/c++/5, assuming those folders exist? If that doesn't work, you can try opening the iostream and child headers to try to find the 1st one with #include files that can't be found.

Problem solved.
My configuration now:

{
    "name": "Linux",
    "includePath": [
        "${workspaceRoot}",
        "/usr/include/c++/5",
        "/usr/local/include",
        "/usr/include",
        "/usr/include/x86_64-linux-gnu",
        "usr/include/x86_64-linux-gnu/c++/5"
    ],
    "defines": [],
    "browse": {
        "path": [
            "/usr/include/c++/5",
            "/usr/local/include",
            "/usr/include"
        ],
        "limitSymbolsToIncludedHeaders": true,
        "databaseFilename": ""
    }
}

Thank you!

For others, who may find this issue relevant, your version could be different, e.g., /usr/include/x86_64-linux-gnu/c++/4.8. Simply check with ls /usr/include/x86_64-linux-gnu/c++/.

Was this page helpful?
0 / 5 - 0 ratings