# Why is cmake trying to use libstdc++ for C++ modules on android?

**URL:** https://discourse.cmake.org/t/why-is-cmake-trying-to-use-libstdc-for-c-modules-on-android/15038
**Category:** Usage
**Created:** [August 17, 2025, 1:46pm UTC](https://discourse.cmake.org/t/why-is-cmake-trying-to-use-libstdc-for-c-modules-on-android/15038 "2025-08-17T13:46:27Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![mccakit](https://discourse.cmake.org/user_avatar/discourse.cmake.org/mccakit/32/5628_2.png) [@mccakit](https://discourse.cmake.org/u/mccakit)
#### Post date: [August 17, 2025, 1:46pm UTC](https://discourse.cmake.org/t/why-is-cmake-trying-to-use-libstdc-for-c-modules-on-android/15038/1 "2025-08-17T13:46:27Z")

</div>

```auto
set(ANDROID_PLATFORM 30)
set(ANDROID_ABI arm64-v8a)
set(ANDROID_STL c++_static)
include(
    /home/mccakit/dev/android-clt/ndk/29.0.13599879/build/cmake/android.toolchain.cmake
)
add_compile_options(-nostdinc++ -nostdlib++ -cxx-isystem /home/mccakit/dev/libcxx/android-arm64/include/c++/v1)
add_link_options(-L/home/mccakit/dev/libcxx/android-arm64/lib)

```

```auto
CMake Error in apps/CMakeLists.txt:
  The "CXX_MODULE_STD" property on the target "main" requires that the
  "__CMAKE::CXX23" target exist, but it was not provided by the toolchain.
  Reason:
    `libstdc++.modules.json` resource does not exist

```

---

<div class="post-metadata">

### Author: ![bill.hoffman](https://discourse.cmake.org/user_avatar/discourse.cmake.org/bill.hoffman/32/13_2.png) [@bill.hoffman](https://discourse.cmake.org/u/bill.hoffman)
#### Post date: [August 18, 2025, 3:21pm UTC](https://discourse.cmake.org/t/why-is-cmake-trying-to-use-libstdc-for-c-modules-on-android/15038/2 "2025-08-18T15:21:02Z")

</div>

Looks like you are using “import std”. Not sure I see how that is being turned on by looking at the cmake you posted. The not finding libstdc++.modules.json is a clang issue. We are working on a way to force the location of this when the compiler can’t tell us where that file is located.
