# Intellisense not detecting standard libraries in Visual Studio

**URL:** https://discourse.cmake.org/t/intellisense-not-detecting-standard-libraries-in-visual-studio/15571
**Category:** Code
**Created:** [March 23, 2026, 9:20am UTC](https://discourse.cmake.org/t/intellisense-not-detecting-standard-libraries-in-visual-studio/15571 "2026-03-23T09:20:36Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![shrink\_tubing](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/s/a4c791/32.png) [@shrink\_tubing](https://discourse.cmake.org/u/shrink_tubing)
#### Post date: [March 23, 2026, 9:20am UTC](https://discourse.cmake.org/t/intellisense-not-detecting-standard-libraries-in-visual-studio/15571/1 "2026-03-23T09:20:36Z")

</div>

Hi,

Frequently when opening a cmake project in visual studio there’s a bug where intellisense cannot recognize some of the C++ standard libraries. I have found a workaround, if I intentionally break my CMakePresets.json file and then unbreak it and save it, the problem goes away.

This isn’t a very good practice though, so I’d like to find a proper solution. Here’s a look at my simple CMakePresets.json file:

```auto
{
  "version": 3,
  "configurePresets": [
    {
      "binaryDir": "build",
      "generator": "Visual Studio 17 2022",
      "name": "default"
    }
  ],

  "buildPresets": [
    {
      "name": "default",
      "configurePreset": "default"
    }
  ]
}

```

AFAIK the issue stems from there being some sort of difference between the compiler used in your cmake project, and the one used by intellisense to check your code. I believe there is a way to add a vendor field to your CMakePresets.json file and force intellisense to behave in a certain way that prevents this, but I don’t know how to do that (if that’s even the correct solution). I’m writing C++ and using C++ 20 standard. I might also add I’m using VS 2022.

I hope that makes sense, I’m still quite new to this and sometimes it feels very overwhelming ☹

Any insight at all into this would be most appreciated, thank you.

---

<div class="post-metadata">

### Author: ![LegalizeAdulthood](https://discourse.cmake.org/user_avatar/discourse.cmake.org/legalizeadulthood/32/5282_2.png) [@LegalizeAdulthood](https://discourse.cmake.org/u/LegalizeAdulthood)
#### Post date: [March 23, 2026, 4:28pm UTC](https://discourse.cmake.org/t/intellisense-not-detecting-standard-libraries-in-visual-studio/15571/2 "2026-03-23T16:28:29Z")

</div>

> [@shrink\_tubing](#):
>
> Frequently when opening a cmake project in visual studio there’s a bug where intellisense cannot recognize some of the C++ standard libraries.

I’ve never experienced this; can you make a reproducer?

---

<div class="post-metadata">

### Author: ![shrink\_tubing](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/s/a4c791/32.png) [@shrink\_tubing](https://discourse.cmake.org/u/shrink_tubing)
#### Post date: [March 23, 2026, 5:01pm UTC](https://discourse.cmake.org/t/intellisense-not-detecting-standard-libraries-in-visual-studio/15571/3 "2026-03-23T17:01:19Z")

</div>

I’ll need a bit of time to do that Richard, but I’ll have a go! Thanks.

---

<div class="post-metadata">

### Author: ![shrink\_tubing](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/s/a4c791/32.png) [@shrink\_tubing](https://discourse.cmake.org/u/shrink_tubing)
#### Post date: [March 24, 2026, 1:45pm UTC](https://discourse.cmake.org/t/intellisense-not-detecting-standard-libraries-in-visual-studio/15571/4 "2026-03-24T13:45:53Z")

</div>

Well, after spending the day trying to re-create the problem, now I can’t 🤔

It seems it usually happens whenever I copy the project to another folder and re-generate. Whenever I do this I clear out the build folder, otherwise it complains that the CMakeCache file contains bad paths.

I’ve tried this however with a simple test project and it still isn’t reappearing. The next time I see it I’ll stop what I’m doing and upload the whole project to a OneDrive location you can download from and inspect if you like.

Sorry to not be able to give a clearer explanation but at this time I can’t 😐

---

<div class="post-metadata">

### Author: ![shrink\_tubing](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/s/a4c791/32.png) [@shrink\_tubing](https://discourse.cmake.org/u/shrink_tubing)
#### Post date: [April 5, 2026, 5:58pm UTC](https://discourse.cmake.org/t/intellisense-not-detecting-standard-libraries-in-visual-studio/15571/5 "2026-04-05T17:58:12Z")

</div>

Ok here is a version of the project that has the bug. It’s a simple(ish) SDL3 project and will certainly contain files not needed to examine the bug. However not wanting to accidentally remove the error I have simply included everything to be sure. It’s a 40MB download zip expanding to 120MB when uncompressed just for your information.

[CMake project containing Intellisense error.](https://1drv.ms/u/c/26dc5bc9d9cfeb03/IQA28N5mBz5FRp5Uw50vnNvBAfg0LtaeG29gydm8p3QMsag?e=h1aZh3)

It only ever happens when copying files from an existing project into a new one, and then removing the Cache and rebuilding.

Thanks.

---

<div class="post-metadata">

### Author: ![shrink\_tubing](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/s/a4c791/32.png) [@shrink\_tubing](https://discourse.cmake.org/u/shrink_tubing)
#### Post date: [April 5, 2026, 6:05pm UTC](https://discourse.cmake.org/t/intellisense-not-detecting-standard-libraries-in-visual-studio/15571/6 "2026-04-05T18:05:54Z")

</div>

p.s. If you intentionally break the CMakePresets.json file (add an extra curly bracket } where it shouldn’t be) and then build, Visual Studio will default to a standard configuration. If you then un-break the CMakePresets.json file and rebuild it returns to normal with the error no longer present.
