Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WSL] Intellisense does not work without g++ (e.g. only with gcc installed) #2178

Closed
n3rd4i opened this issue Jun 23, 2018 · 4 comments
Closed
Labels
bug fixed Check the Milestone for the release in which the fix is or will be available. Language Service
Milestone

Comments

@n3rd4i
Copy link

n3rd4i commented Jun 23, 2018

Type: LanguageService

Describe the bug

  • OS and Version: Microsoft Windows [Version 10.0.17692.1000]
  • VS Code Version: 1.24.1
  • C/C++ Extension Version: 0.17.5
  • Other extensions you installed (and if the issue persists after disabling them): N/A

Probably documentation issue, as in the docs: vscode-cpptools/Documentation/LanguageServer/Windows Subsystem for Linux.md, there is no clear specification about what "Prerequisites" are required so that vscode-cpptools (at least the newer versions) which assume system includes paths from gcc, are.
As a side comment, this information is provided in vscode-cpptools/Documentation/Debugger/gdb/Windows Subsystem for Linux.md, but there is a catch, from document one could understand that he could install either g++ or gcc, and both work, but thats not the case. I've found that actually g++ is needed to run such command:
gcc -v -E -x c++ - < /dev/null

To Reproduce
Steps to reproduce the behavior:

  1. Install WSL and GCC inside WSL (e.g. gcc-4.8)
  2. run: `gcc -v -E -x c++ - < /dev/null``
  3. there is no "#include <...> search starts here:" section
  4. the vscode_cpptools extension cannot work without this information it seems,
    e.g. #include <stdio.h> is not found in the system.

Expected behavior
I believe the documentation must be update to explicit this behaviour. This can even be copied from GDB section and updated accordingly

@bobbrow
Copy link
Member

bobbrow commented Jun 25, 2018

Are you developing in C or C++? It is my understanding that if you don't install g++ you won't have any c++ headers to work with so you wouldn't be able to compile your code either. But we can update the documentation to be more explicit here, or you are welcome to submit a PR with the documentation changes and we'll happily review it.

But there is an actual bug in the extension here, so thank you for bringing this to our attention! The code that detects whether we need to turn on case-sensitive file support for WSL is looking at the C++ compiler info to make the determination, but since the C++ detection fails without g++ installed, case-sensitive file support isn't being turned on for C files, so IntelliSense is currently broken for those too. Installing g++ fixes it, but we did not intentionally add g++ as a requirement to work with C files.

@bobbrow bobbrow added bug Language Service docs Issue related to documentation about the extension labels Jun 25, 2018
@bobbrow bobbrow added this to the 0.17.6 milestone Jun 25, 2018
@sean-mcmanus sean-mcmanus added the fixed Check the Milestone for the release in which the fix is or will be available. label Jun 26, 2018
@sean-mcmanus
Copy link
Contributor

@bobbrow Were you going to update the docs?

@bobbrow
Copy link
Member

bobbrow commented Jun 26, 2018

I'm not sure that there's a need to update the docs after we fix the bug. g++ shouldn't have been a pre-requisite.

@sean-mcmanus sean-mcmanus removed the docs Issue related to documentation about the extension label Jun 26, 2018
@sean-mcmanus
Copy link
Contributor

Should be fixed with 0.17.6.

@github-actions github-actions bot locked and limited conversation to collaborators Oct 13, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug fixed Check the Milestone for the release in which the fix is or will be available. Language Service
Projects
None yet
Development

No branches or pull requests

3 participants