4

I'm using Visual Studio Code on my Linux laptop. I just wrote a simple program like this one in main.cpp:

#include<iostream>

int main()
{

}

Yesterday everything was working just fine. Today I open a new file and it says it doesnt recognize any of STL libraries. This is what I get when I hover over it:

#include errors detected. Please update your includePath. Squiggles are disabled for this translation unit (/home/john/Documents/main.cpp).C/C++(1696)
cannot open source file "iostream"C/C++(1696)

I run a few command to check my compiler and setting. Those are my intellisense settings:

{
    "configurations": [
        {
            "name": "Linux",
            "includePath": [
                "${workspaceFolder}/**"
            ],
            "defines": [],
            "compilerPath": "/usr/bin/clang",
            "cStandard": "c11",
            "cppStandard": "c++17",
            "configurationProvider": "go2sh.cmake-integration"
        }
    ],
    "version": 4
}

This is some info about my g++ compiler and my clang compiler:

g++

john@john-GL63-8RC:~$ whereis g++
g++: /usr/bin/g++ /usr/share/man/man1/g++.1.gz
john@john-GL63-8RC:~$ g++ --version
g++ (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

clang:

john@john-GL63-8RC:~$ whereis clang
clang: /usr/bin/clang /usr/lib/clang /usr/include/clang /usr/share/man/man1/clang.1.gz
john@john-GL63-8RC:~$ clang --version
clang version 6.0.0-1ubuntu2 (tags/RELEASE_600/final)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin

Also I think they are old but all I did was to install the via apt-get how do I update them? How can I repair it? I didnt change anything and it just started going crazy by itself

John
  • 197
  • 1
  • 3
  • 14
  • What about https://stackoverflow.com/questions/18289936/refreshing-the-auto-complete-intellisense-database-in-visual-studio or https://stackoverflow.com/questions/47700939/how-to-reset-intellisense-in-vs-code – Jerry Jeremiah Mar 03 '20 at 20:32
  • I just looked up my /usr/include/x86_64-linux-gnu/c++/ and there are no header files! How did it happen? Like if iostream and other files evaporated – John Mar 03 '20 at 20:46
  • 1
    I don't see how they could disappear. You're only option is to reinstall the compiler I think. – Jerry Jeremiah Mar 03 '20 at 20:57
  • 2
    I did reinstall it and the files are now there. iostream, vector etc are there. And the proper directory is given. But it still doesn't see them! I mean the intellisense How can this be possible? – John Mar 03 '20 at 21:45

0 Answers0