# toolchain's CMAKE\_CXX\_STANDARD\_LIBRARIES\_INIT get overridden

**URL:** https://discourse.cmake.org/t/toolchains-cmake-cxx-standard-libraries-init-get-overridden/12672
**Category:** Usage
**Created:** [October 3, 2024, 12:48pm UTC](https://discourse.cmake.org/t/toolchains-cmake-cxx-standard-libraries-init-get-overridden/12672 "2024-10-03T12:48:12Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![redbaron](https://discourse.cmake.org/user_avatar/discourse.cmake.org/redbaron/32/2129_2.png) [@redbaron](https://discourse.cmake.org/u/redbaron)
#### Post date: [October 3, 2024, 12:48pm UTC](https://discourse.cmake.org/t/toolchains-cmake-cxx-standard-libraries-init-get-overridden/12672/1 "2024-10-03T12:48:12Z")

</div>

Following [advice](https://discourse.cmake.org/t/is-there-a-downside-for-a-toolchain-to-set-vars-in-cache-instead-of-init/12034), I am altering toolchain to include just \_INIT vars, but I seem to hit a [problem](https://gitlab.kitware.com/cmake/cmake/-/issues/24342) where what looks like `Windows-MSVC` platform file overrides `CMAKE_CXX_STANDARD_LIBRARIES_INIT`.

Do I do something wrong? I added print points at various positions and got following:

```auto
-- pre project()
-- CMAKE_CXX_STANDARD_LIBRARIES_INIT="" ; CMAKE_CXX_STANDARD_LIBRARIES=""

-- end of toolchain
-- CMAKE_CXX_STANDARD_LIBRARIES_INIT="vendor.lib" ; CMAKE_CXX_STANDARD_LIBRARIES=""

-- in 'CMAKE_USER_MAKE_RULES_OVERRIDE'
-- CMAKE_CXX_STANDARD_LIBRARIES_INIT="kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib" ; CMAKE_CXX_STANDARD_LIBRARIES=""

-- past project
-- CMAKE_CXX_STANDARD_LIBRARIES_INIT="kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib" ; CMAKE_CXX_STANDARD_LIBRARIES="kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib"

```

Do I do anything wrong? `CMAKE_CXX_STANDARD_LIBRARIES_INIT` is [documented](https://cmake.org/cmake/help/latest/variable/CMAKE_LANG_STANDARD_LIBRARIES.html) to be used by toolchains, but setting it there has no effect.
