# Unable to set up a C++ dev environment because of conflicting stdlibs

**URL:** https://discourse.nixos.org/t/unable-to-set-up-a-c-dev-environment-because-of-conflicting-stdlibs/69401
**Category:** Help
**Created:** [September 15, 2025, 12:36am UTC](https://discourse.nixos.org/t/unable-to-set-up-a-c-dev-environment-because-of-conflicting-stdlibs/69401 "2025-09-15T00:36:29Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![waffle8946](https://discourse.nixos.org/user_avatar/discourse.nixos.org/waffle8946/32/27221_2.png) [@waffle8946](https://discourse.nixos.org/u/waffle8946)
#### Post date: [September 15, 2025, 2:22am UTC](https://discourse.nixos.org/t/unable-to-set-up-a-c-dev-environment-because-of-conflicting-stdlibs/69401/2 "2025-09-15T02:22:20Z")

</div>

> [@Clang, clang++, and clangd can't find headers, even with compile\_commands.json](https://discourse.nixos.org/t/clang-clang-and-clangd-cant-find-headers-even-with-compile-commands-json/54657/6):
>
> What you’re meant to do is override the stdenv if you want it to use clang: pkgs.mkShell.override { stdenv = clang19Stdenv; } { packages = [pkgs.cmake # ... whatever else, but NOT C compilers though!]; } (or inherit (llvmPackages\_19) stdenv;, if you prefer) and instead of the deprecated devShell.\<system\>, use devShells.\<system\>.default.

And remove the funny envvars.

---

_[View the full topic](https://discourse.nixos.org/t/unable-to-set-up-a-c-dev-environment-because-of-conflicting-stdlibs/69401)._
