0

I am having problems getting VS Code’s Intellisense for C++ to work. I am using Windows 10, g++ and gdb. I have installed the extensions C/C++ for Visual Studio Code and the C/C++ Extension Pack.

If I write msg, for example, main, mitl, module and mutable will appear, but that’s it - essentially, I get a partial list. The subsequent ‘s’ and ‘g’ of msg produce nothing nor does the normally triggering dot or full stop after msg (msg.) Even the simplest printf produces only private, protected, and pragma, but printf is never an option.

I have uninstalled and reinstalled VS Code to no avail. I have also deleted all extensions and reinstalled them as per Completely uninstall VS Code extensions, again, without success. A simple piece of code compiled without issue, but when I changed the source code file for something a little more complicated the following messages appeared.

Please update #include errors detected. Please update your includePAth. IntelliSense features fro this translation unit(C/NOTES/Programming/VSCODE/helloworld.cp) will be provided by the tag parser

*[2/1/2023, 10:54:07 PM] For C++ source files, IntelliSenseMode was changed from "windows-gcc-x64" to "windows-msvc-x64" based on compiler args and querying compilerPath: "C:\ghcup\ghc\9.2.5\mingw\bin\gcc.exe"

[2/1/2023, 10:54:07 PM] For C source files, IntelliSenseMode was changed from "windows-gcc-x64" to "windows-msvc-x64" based on compiler args and querying compilerPath: "C:\ghcup\ghc\9.2.5\mingw\bin\gcc.exe"*

Is it a case of IntelliSense looking at the C compiler (gcc.exe) and not the C++ compiler (g++.exe) and if so how can I change that?

Max360
  • 1
  • 2
  • Provide a [mre] of the code-completion scenario and say what you expect to see. – starball Feb 01 '23 at 18:15
  • The new messages from VS Code (see above) may shed some light on the problem. – Max360 Feb 02 '23 at 20:49
  • Where are the standard library headers located in your installation of g++? Edit to add the output from following the instructions in [this Q&A](https://stackoverflow.com/a/17940219/11107541). – starball Feb 02 '23 at 20:52

0 Answers0