Intellisense not working with Linux projects

I was having an annoying problem with intellisense in my Linux project.

Even though the project was building all completely and successfully, the error window was showing a bunch of errors saying “…cannot open source file…”.

Also if I wanted to open the file from the standard C++ library, e.g. <string> it wouldn’t open either.

I looked for an answer online using several search engines and even tried other tools like GPTChat to not avail.

I realized that I could open some other files though and they were located in a cache folder.  Browse up this folder and noticed that there were the files the Visual Studio couldn’t find.

Maybe Visual Studio (Intellisense) were not able to locate those files.  So, what if I backup the cache folder and then make Visual Studio through CMake to regenerate it.

That was it!

I closed Visual Studio.

Then renamed the folder “C:\Users\leon\AppData\Local\Microsoft\Linux” to “C:\Users\leon\AppData\Local\Microsoft\Linux.bak”.

Reopen Visual Studio and CMake started recreating the cache.

And voila!

The Intellisense errors disappeared and I can now open the file from the C++ standard library using for example the shortcut F12.