Skip to content

Setting default Intellisense settings for Ubuntu WSL's gcc #2855

@AhmedYasinKUL

Description

@AhmedYasinKUL

Type: LanguageService

  • OS and Version: Windows 10 / 10.0.17134
  • VS Code Version: 1.29.1 (user setup)
  • C/C++ Extension Version: 0.20.1
  • Other extensions you installed (and if the issue persists after disabling them): The other extensions are not related with C/C++ extension

Problem: I have clearly installed Windows 10 to my computer and then I have installed Ubuntu (18.04) WSL application and I installed gcc-4.8 to my Ubuntu WSL. I haven't installed any other compiler or something like that. Then I want to use this gcc-4.8 installation which is on Ubuntu, to enable Intellisense feature of extension. I found a documentation link: "https://github.com/Microsoft/vscode-cpptools/blob/master/Documentation/LanguageServer/Windows%20Subsystem%20for%20Linux.md". I applied these steps for a folder specific settings and it works clearly. Then, I want to set this gcc-4.8 Intellisense settings as default. So, I want to Intellisense works even if I didn't open a folder, only opened a C++ file. For this case, I edited C/C++ extension settings from settings and set default compiler path to "/usr/bin/gcc". When I have saved and restarted VSCode, the output of extension shows an error:
"
Attempting to get defaults from compiler found on the machine: ' '
Attempting to get defaults from compiler found on the machine: /usr/bin/gcc
Failed to spawn process. Error: 2 (The system cannot find the file specified.)
cpptools/activeDocumentChange
cpptools/textEditorSelectionChange
cpptools/didChangeFolderSettings
Attempting to get defaults from compiler in "compilerPath" property: '/usr/bin/gcc'
Failed to spawn process. Error: 2 (The system cannot find the file specified.)
Code browsing service initialized
Attempting to get defaults from compiler in "compilerPath" property: '/usr/bin/gcc'
Failed to spawn process. Error: 2 (The system cannot find the file specified.)
"

So, it gives this error and Intellisense is not working correctly. It gives an error for stdlib.h library include. I tried a lot of things to solve this problem but none of them has worked.

Here is a part of my settings.json:
"
"C_Cpp.intelliSenseEngineFallback": "Disabled",
"C_Cpp.default.cStandard": "c11",
"C_Cpp.default.cppStandard": "c++17",
"C_Cpp.loggingLevel": "Debug",
"C_Cpp.default.windowsSdkVersion": "10.0.17134.0",
"

Metadata

Metadata

Assignees

No one assigned

    Labels

    Language ServicebugfixedCheck the Milestone for the release in which the fix is or will be available.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions