# \#os:windows

**URL:** https://discourse.cmake.org/tag/os-windows/2.md?match_all_tags=true&page=1&tags%5B%5D=os%3Awindows

[Latest](https://discourse.cmake.org/latest.md) · [Categories](https://discourse.cmake.org/categories.md) · [Tags](https://discourse.cmake.org/tags.md)

**Page:** 2

---

## [CMake expert seeking for paid consultancy work](https://discourse.cmake.org/t/cmake-expert-seeking-for-paid-consultancy-work/15582)

<div class="topic-metadata">

**Author:** [@flinco](https://discourse.cmake.org/u/flinco)\
**Replies:** 0\
**Last updated:** [March 30, 2026, 9:54am UTC](https://discourse.cmake.org/t/cmake-expert-seeking-for-paid-consultancy-work/15582 "2026-03-30T09:54:50Z")

</div>

I am a professional C developer and, in my spare time, I have developed a C++ Qt application for timing running races. The application is open-source (GPL 3) and uses CMake for compilation and to build the installer. Th…

---

## [\*.tlh files always dirty with Ninja Multi-config](https://discourse.cmake.org/t/tlh-files-always-dirty-with-ninja-multi-config/15580)

<div class="topic-metadata">

**Author:** [@RobinD42](https://discourse.cmake.org/u/RobinD42)\
**Replies:** 0\
**Last updated:** [March 28, 2026, 3:09am UTC](https://discourse.cmake.org/t/tlh-files-always-dirty-with-ninja-multi-config/15580 "2026-03-28T03:09:25Z")

</div>

We have a project with some C++ files using #import with \*.tlb files. I’ve noticed that with the Ninja Multi-Config generator the tlh and tli files end up in the base of the build folder. However with the single-config N…

---

## [Is there a guide on how to configure CMake with MinGW/MSYS and git on Windows?](https://discourse.cmake.org/t/is-there-a-guide-on-how-to-configure-cmake-with-mingw-msys-and-git-on-windows/15563)

<div class="topic-metadata">

**Author:** [@Lars](https://discourse.cmake.org/u/Lars)\
**Replies:** 10\
**Last updated:** [March 21, 2026, 7:38pm UTC](https://discourse.cmake.org/t/is-there-a-guide-on-how-to-configure-cmake-with-mingw-msys-and-git-on-windows/15563 "2026-03-21T19:38:53Z")

</div>

Hi all, I am a maintainer of a library (OpenXLSX) and have recently augmented the CMake configuration to auto-pull dependencies via find\_package or FetchContent from their source repositories, instead of including a cop…

---

## [Unable to build Eigen & OpenXLSX on windows](https://discourse.cmake.org/t/unable-to-build-eigen-openxlsx-on-windows/10868)

<div class="topic-metadata">

**Author:** [@Shepard](https://discourse.cmake.org/u/Shepard)\
**Replies:** 2\
**Last updated:** [March 19, 2026, 11:27am UTC](https://discourse.cmake.org/t/unable-to-build-eigen-openxlsx-on-windows/10868 "2026-03-19T11:27:22Z")

</div>

Well, I’m working on a C++ project where I am using linear algebra from Eigen. This is how I fetch the Eigen library from my root CmakeLists.txt: message(\[STATUS\] "Fetching eigen.") block(SCOPE\_FOR VARIABLES) set(E…

---

## [Problem with CMake when compiling a project with Clang and CUDA support](https://discourse.cmake.org/t/problem-with-cmake-when-compiling-a-project-with-clang-and-cuda-support/11723)

<div class="topic-metadata">

**Author:** [@AAUDI](https://discourse.cmake.org/u/AAUDI)\
**Replies:** 1\
**Last updated:** [March 12, 2026, 5:01pm UTC](https://discourse.cmake.org/t/problem-with-cmake-when-compiling-a-project-with-clang-and-cuda-support/11723 "2026-03-12T17:01:23Z")

</div>

Hello, I’m trying to build an open-source project called VORTEX on Windows using CLANG as the compiler. However, when I run the CMake command, it seems that the NVCC (CUDA) compiler is not being detected. Could you plea…

---

## [How to set $PATH for try\_compile runs, and during build?](https://discourse.cmake.org/t/how-to-set-path-for-try-compile-runs-and-during-build/10256)

<div class="topic-metadata">

**Author:** [@garyo](https://discourse.cmake.org/u/garyo)\
**Replies:** 4\
**Last updated:** [March 11, 2026, 3:53pm UTC](https://discourse.cmake.org/t/how-to-set-path-for-try-compile-runs-and-during-build/10256 "2026-03-11T15:53:11Z")

</div>

I’m trying to use CUDA with clang-cl (or just plain cl.exe) on Windows, using Mark Schofield’s Windows toolchain. The toolchain finds cl.exe, but then when CMake tries to find CUDA it fails, because nvcc can’t find compi…

---

## [error when building the project saying "cmake version 3.26.4-msvc4"](https://discourse.cmake.org/t/error-when-building-the-project-saying-cmake-version-3-26-4-msvc4/15531)

<div class="topic-metadata">

**Author:** [@tomcy](https://discourse.cmake.org/u/tomcy)\
**Replies:** 0\
**Last updated:** [February 26, 2026, 11:09am UTC](https://discourse.cmake.org/t/error-when-building-the-project-saying-cmake-version-3-26-4-msvc4/15531 "2026-02-26T11:09:30Z")

</div>

Sometimes when I run a CMake project, an error is reported: “Severity Code Description Project File Line Suppression State” Error: cmake version 3.26.4-msvc4 “Sometimes, deleting and regenerating the ‘out’ directory re…

---

## ["Cannot find source file" when library is linked to a particular executable](https://discourse.cmake.org/t/cannot-find-source-file-when-library-is-linked-to-a-particular-executable/15527)

<div class="topic-metadata">

**Author:** [@codeling](https://discourse.cmake.org/u/codeling)\
**Replies:** 3\
**Last updated:** [February 24, 2026, 9:32pm UTC](https://discourse.cmake.org/t/cannot-find-source-file-when-library-is-linked-to-a-particular-executable/15527 "2026-02-24T21:32:31Z")

</div>

I am in the process of migrating an existing project to CMake. In it, I have several libraries and executables; When I add one of the library targets (let’s say library lib) to the main executable (let’s call it exe), a…

---

## [How to add a cppm static library with the same configuration as lib\_\_cmake\_cxx23a](https://discourse.cmake.org/t/how-to-add-a-cppm-static-library-with-the-same-configuration-as-lib-cmake-cxx23a/15302)

<div class="topic-metadata">

**Author:** [@mochunshuang](https://discourse.cmake.org/u/mochunshuang)\
**Replies:** 13\
**Last updated:** [February 20, 2026, 2:20pm UTC](https://discourse.cmake.org/t/how-to-add-a-cppm-static-library-with-the-same-configuration-as-lib-cmake-cxx23a/15302 "2026-02-20T14:20:07Z")

</div>

I found that the generated printing of the library is inconsistent, so I am here to ask. \[main\] 正在配置项目: vulkan \[proc\] 正在执行命令: E:\\mysoftware\\cmake-4.2.0-rc2-windows-x86\_64\\bin\\cmake.EXE -DCMAKE\_INSTALL\_PREFIX=E:/0\_githu…

---

## [shm\_open in rt - not found when trying to install a library using CMake](https://discourse.cmake.org/t/shm-open-in-rt-not-found-when-trying-to-install-a-library-using-cmake/15303)

<div class="topic-metadata">

**Author:** [@Claas\_Machens](https://discourse.cmake.org/u/Claas_Machens)\
**Replies:** 3\
**Last updated:** [February 20, 2026, 2:30am UTC](https://discourse.cmake.org/t/shm-open-in-rt-not-found-when-trying-to-install-a-library-using-cmake/15303 "2026-02-20T02:30:50Z")

</div>

I am new to CMake. I wanted to Install the OpenFHE library, which instructs to use CMake to do so. (The Library states it is tested and build on MinGW (64-bit) on Windows 10, while I use MinGW64 on Windows 11, but I hope…

---

## [Using ccache with Visual Studio generator and ClangCL toolset](https://discourse.cmake.org/t/using-ccache-with-visual-studio-generator-and-clangcl-toolset/15497)

<div class="topic-metadata">

**Author:** [@retif](https://discourse.cmake.org/u/retif)\
**Replies:** 2\
**Last updated:** [February 16, 2026, 11:06am UTC](https://discourse.cmake.org/t/using-ccache-with-visual-studio-generator-and-clangcl-toolset/15497 "2026-02-16T11:06:25Z")

</div>

I am looking at enabling ccache in my projects, and I got it working on/with almost all the platforms/generators that I need. The “Professional CMake” book was a great help with that (big thanks to @craig.scott, as usual)…

---

## [failed to generate fastbuild](https://discourse.cmake.org/t/failed-to-generate-fastbuild/15378)

<div class="topic-metadata">

**Author:** [@TimeLooper](https://discourse.cmake.org/u/TimeLooper)\
**Replies:** 2\
**Last updated:** [February 15, 2026, 10:54pm UTC](https://discourse.cmake.org/t/failed-to-generate-fastbuild/15378 "2026-02-15T22:54:14Z")

</div>

CMake Error at C:/Program Files/CMake/share/cmake-4.2/Modules/CMakeTestCCompiler.cmake:67 (message): The C compiler "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x…

---

## [Still needing those administrative privileges](https://discourse.cmake.org/t/still-needing-those-administrative-privileges/15374)

<div class="topic-metadata">

**Author:** [@grafl](https://discourse.cmake.org/u/grafl)\
**Replies:** 1\
**Last updated:** [February 9, 2026, 5:06am UTC](https://discourse.cmake.org/t/still-needing-those-administrative-privileges/15374 "2026-02-09T05:06:51Z")

</div>

Hi, my issue is quite simple, it generates the buildsystem for a custom library and an executable. cmake\_minimum\_required(VERSION 4.0) project(my\_library LANGUAGES C VERSION 0.0.1) include(cmake/ResolveDependencies.cma…

---

## [import std appears to be broken in release 4.0.2](https://discourse.cmake.org/t/import-std-appears-to-be-broken-in-release-4-0-2/14062)

<div class="topic-metadata">

**Author:** [@abbator](https://discourse.cmake.org/u/abbator)\
**Replies:** 5\
**Last updated:** [February 9, 2026, 3:47am UTC](https://discourse.cmake.org/t/import-std-appears-to-be-broken-in-release-4-0-2/14062 "2026-02-09T03:47:06Z")

</div>

I attempted to upgrade to 4.0.2 but found that my modules projects using import std are now unbuildable. I’m using Visual Studio Community 17.15.0 Preview 4.0 + Ninja. After fiddling across a large-scale project with a …

---

## [CMake 4.0+ treats \\" in path end as escaped quote on Windows](https://discourse.cmake.org/t/cmake-4-0-treats-in-path-end-as-escaped-quote-on-windows/15487)

<div class="topic-metadata">

**Author:** [@Wovchena](https://discourse.cmake.org/u/Wovchena)\
**Replies:** 2\
**Last updated:** [February 3, 2026, 2:51pm UTC](https://discourse.cmake.org/t/cmake-4-0-treats-in-path-end-as-escaped-quote-on-windows/15487 "2026-02-03T14:51:36Z")

</div>

Create build.bat in cmake-4.2.3-tutorial-source\\Step0 downloaded from https://cmake.org/cmake/help/latest/guide/tutorial/index.html with the following content set "SAMPLES\_SOURCE\_DIR=%~dp0" cmake "%SAMPLES\_SOURCE\_DIR%" …

---

## [cmake 4.2.2 not able to detect VS2026 outside 'developer command prompt'?](https://discourse.cmake.org/t/cmake-4-2-2-not-able-to-detect-vs2026-outside-developer-command-prompt/15478)

<div class="topic-metadata">

**Author:** [@Andre\_Weissflog](https://discourse.cmake.org/u/Andre_Weissflog)\
**Replies:** 1\
**Last updated:** [February 1, 2026, 11:56am UTC](https://discourse.cmake.org/t/cmake-4-2-2-not-able-to-detect-vs2026-outside-developer-command-prompt/15478 "2026-02-01T11:56:26Z")

</div>

Good day. When setting up a new Win11 dev machine with VS2026 Community Edition I’m running into trouble that cmake doesn’t seem to be able to detect Visual Studio (specifically VS2026) unless it’s running inside the ‘Vi…

---

## [Cmake not recognising header file for some reason](https://discourse.cmake.org/t/cmake-not-recognising-header-file-for-some-reason/15466)

<div class="topic-metadata">

**Author:** [@Maaz\_Madha](https://discourse.cmake.org/u/Maaz_Madha)\
**Replies:** 1\
**Last updated:** [January 19, 2026, 3:41pm UTC](https://discourse.cmake.org/t/cmake-not-recognising-header-file-for-some-reason/15466 "2026-01-19T15:41:32Z")

</div>

Hi all I am trying to compile my project via cmake and ninja, and I’m receiving this error error: ‘STA\_NODISK’ undeclared (first use in this function) 196 | return tuh\_msc\_mounted(dev\_addr) ? 0 : STA\_NODISK; | …

---

## [Linker error with CXX\_MODULES](https://discourse.cmake.org/t/linker-error-with-cxx-modules/15449)

<div class="topic-metadata">

**Author:** [@ClausKlein](https://discourse.cmake.org/u/ClausKlein)\
**Replies:** 4\
**Last updated:** [January 12, 2026, 12:33am UTC](https://discourse.cmake.org/t/linker-error-with-cxx-modules/15449 "2026-01-12T00:33:14Z")

</div>

I have a project that build Boost with CXX\_MODULES. It works on Linux and OSX, but not on windows? The type\_index lib is a header only module the any lib too. The any module itself imports the type\_index. \[367/557\] Lin…

---

## [MSVC 18 support](https://discourse.cmake.org/t/msvc-18-support/15446)

<div class="topic-metadata">

**Author:** [@Ravenwater](https://discourse.cmake.org/u/Ravenwater)\
**Replies:** 2\
**Last updated:** [January 8, 2026, 12:31am UTC](https://discourse.cmake.org/t/msvc-18-support/15446 "2026-01-08T00:31:24Z")

</div>

I just installed MSVC 18, but my CMake v3.31.6 is not seeing it. Not finding any coherent documentation that explains what is going on. Is anyone generating MSVC 18 solution files with their CMake?

---

## [FIND\_PACKAGE working at main level, failing on dependencies](https://discourse.cmake.org/t/find-package-working-at-main-level-failing-on-dependencies/15414)

<div class="topic-metadata">

**Author:** [@Joymaker](https://discourse.cmake.org/u/Joymaker)\
**Replies:** 4\
**Last updated:** [January 3, 2026, 7:08am UTC](https://discourse.cmake.org/t/find-package-working-at-main-level-failing-on-dependencies/15414 "2026-01-03T07:08:16Z")

</div>

I’m bringing my CMake world under the Visual Studio umbrella. Lots of things are working, including the finding of packages that I explicitly invoke (whew!). But now I’m having strange problems with FIND\_PACKAGE operatin…

---

## [Generic way to enable cpp files multiprocessing for any project (MSBuild)](https://discourse.cmake.org/t/generic-way-to-enable-cpp-files-multiprocessing-for-any-project-msbuild/15422)

<div class="topic-metadata">

**Author:** [@Andrej730](https://discourse.cmake.org/u/Andrej730)\
**Replies:** 0\
**Last updated:** [December 24, 2025, 8:41am UTC](https://discourse.cmake.org/t/generic-way-to-enable-cpp-files-multiprocessing-for-any-project-msbuild/15422 "2025-12-24T08:41:43Z")

</div>

\-j flag in cmake --build enabled multiprocessing for different Visual Studio projects (e.g. different targets), but typically user needs multiprocessing for different .cpp files and projects, not just projects. Providin…

---

## [Could not find any instance of Visual Studio](https://discourse.cmake.org/t/could-not-find-any-instance-of-visual-studio/15377)

<div class="topic-metadata">

**Author:** [@JRR](https://discourse.cmake.org/u/JRR)\
**Replies:** 3\
**Last updated:** [December 23, 2025, 3:51pm UTC](https://discourse.cmake.org/t/could-not-find-any-instance-of-visual-studio/15377 "2025-12-23T15:51:00Z")

</div>

Hello, I am trying to use cmake 3.23.5 with Visual Studio 2026 to create a Visual Studio 2022 project. Why am I doing this? At work we use cmake 3.23.5 and VS2022. I want to investigate something at home, but Micro…

---

## [Unexpected VS2022 build flag changes with CMake 4.1](https://discourse.cmake.org/t/unexpected-vs2022-build-flag-changes-with-cmake-4-1/15324)

<div class="topic-metadata">

**Author:** [@kwaegel](https://discourse.cmake.org/u/kwaegel)\
**Replies:** 6\
**Last updated:** [December 8, 2025, 4:02pm UTC](https://discourse.cmake.org/t/unexpected-vs2022-build-flag-changes-with-cmake-4-1/15324 "2025-12-08T16:02:55Z")

</div>

I recently tried upgrading CMake and got an unexpected build failure with Visual Studio 2022 suddenly returning LNK1189 (\>65k symbols) for a large private project. After a bunch of testing different versions, it looks li…

---

## [add-compile-options use for alternatives](https://discourse.cmake.org/t/add-compile-options-use-for-alternatives/15337)

<div class="topic-metadata">

**Author:** [@kfsone](https://discourse.cmake.org/u/kfsone)\
**Replies:** 0\
**Last updated:** [November 21, 2025, 9:53pm UTC](https://discourse.cmake.org/t/add-compile-options-use-for-alternatives/15337 "2025-11-21T21:53:21Z")

</div>

add\_compile\_options(/Ob2) on windows will cause msvc to complain on every file that you’re overriding the string(APPEND CMAKE\_${lang}\_FLAGS\_RELWITHDEBINFO\_INIT "${\_MD}${\_Zi} /O2 /Ob1 /DNDEBUG") in the base cmake config. …

---

## [How do you avoid target name conflicts in a multi-config setup?](https://discourse.cmake.org/t/how-do-you-avoid-target-name-conflicts-in-a-multi-config-setup/7711)

<div class="topic-metadata">

**Author:** [@max](https://discourse.cmake.org/u/max)\
**Replies:** 4\
**Last updated:** [November 15, 2025, 5:53pm UTC](https://discourse.cmake.org/t/how-do-you-avoid-target-name-conflicts-in-a-multi-config-setup/7711 "2025-11-15T17:53:02Z")

</div>

I’m forking this discussion off from https://gitlab.kitware.com/cmake/cmake/-/issues/23482. I’ve got some large, pre-built libraries that are released separately for the Debug and Release versions. And I would just like …

---

## [Windows Kernel Mode does not support building without KMDF](https://discourse.cmake.org/t/windows-kernel-mode-does-not-support-building-without-kmdf/15299)

<div class="topic-metadata">

**Author:** [@michael.kwok](https://discourse.cmake.org/u/michael.kwok)\
**Replies:** 0\
**Last updated:** [November 12, 2025, 8:43pm UTC](https://discourse.cmake.org/t/windows-kernel-mode-does-not-support-building-without-kmdf/15299 "2025-11-12T20:43:20Z")

</div>

Hi there, CMake seems to only support generating Windows Kernel Mode projects when CMAKE\_WINDOWS\_KMDF\_VERSION is not defined (Modules/Platform/WindowsKernelModeDriver.cmake · master · CMake / CMake · GitLab). Despite a…

---

## [CMakeLists.txt for Raspberry Pi Pico Project](https://discourse.cmake.org/t/cmakelists-txt-for-raspberry-pi-pico-project/15273)

<div class="topic-metadata">

**Author:** [@DJim53](https://discourse.cmake.org/u/DJim53)\
**Replies:** 4\
**Last updated:** [October 29, 2025, 7:39am UTC](https://discourse.cmake.org/t/cmakelists-txt-for-raspberry-pi-pico-project/15273 "2025-10-29T07:39:56Z")

</div>

I would like to perform the initialisation of a PIO in a function in the raik060spilib.c instead of in raik060spicom.c. So I have include “raik060spicom.pio.h” in raik060spilib.h and raik060spilib.c. However, I don’t u…

---

## [Generator expressions in VS\_DOTNET\_REFERENCE\_refname](https://discourse.cmake.org/t/generator-expressions-in-vs-dotnet-reference-refname/15271)

<div class="topic-metadata">

**Author:** [@retif](https://discourse.cmake.org/u/retif)\
**Replies:** 1\
**Last updated:** [October 28, 2025, 8:34pm UTC](https://discourse.cmake.org/t/generator-expressions-in-vs-dotnet-reference-refname/15271 "2025-10-28T20:34:02Z")

</div>

Are generator expressions supported for the VS\_DOTNET\_REFERENCE\_refname target property? This is how I tried to use it: # the \`some\` is a C# library which needs to refer to the DLL from the target \`thing\` set\_target\_pr…

---

## [C# SDK style projects Any CPU](https://discourse.cmake.org/t/c-sdk-style-projects-any-cpu/5913)

<div class="topic-metadata">

**Author:** [@mattsnowboard](https://discourse.cmake.org/u/mattsnowboard)\
**Replies:** 6\
**Last updated:** [October 21, 2025, 10:08pm UTC](https://discourse.cmake.org/t/c-sdk-style-projects-any-cpu/5913 "2025-10-21T22:08:22Z")

</div>

I can now generate SDK style projects for my C# projects in my c++/C# program. This has enabled me to use .NET6, which is nice. But my one problem is that the sln file generated for Visual Studio forces all of the proje…

---

## [Passing complie definitions to a include\_external\_msproject target](https://discourse.cmake.org/t/passing-complie-definitions-to-a-include-external-msproject-target/15233)

<div class="topic-metadata">

**Author:** [@Tarun](https://discourse.cmake.org/u/Tarun)\
**Replies:** 0\
**Last updated:** [October 11, 2025, 8:30am UTC](https://discourse.cmake.org/t/passing-complie-definitions-to-a-include-external-msproject-target/15233 "2025-10-11T08:30:54Z")

</div>

I have an external csproj which I want build in both linux and windows alongside other regular targets(non-custom targets) that are created using cmake. The idea was to create a custom target and use dotnet 8.0 and it’s …

[Previous page](https://discourse.cmake.org/tag/os-windows/2.md?match_all_tags=true&tags%5B%5D=os%3Awindows)

[Next page](https://discourse.cmake.org/tag/os-windows/2.md?match_all_tags=true&page=2&tags%5B%5D=os%3Awindows)
