# \#comp:msvc

**URL:** https://discourse.cmake.org/tag/comp-msvc/6.md?match_all_tags=true&page=1&tags%5B%5D=comp%3Amsvc

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

**Page:** 2

---

## [Windows resources file and manifest dpi awareness](https://discourse.cmake.org/t/windows-resources-file-and-manifest-dpi-awareness/10247)

<div class="topic-metadata">

**Author:** [@StillWaters77](https://discourse.cmake.org/u/StillWaters77)\
**Replies:** 2\
**Last updated:** [April 17, 2024, 6:10am UTC](https://discourse.cmake.org/t/windows-resources-file-and-manifest-dpi-awareness/10247 "2024-04-17T06:10:50Z")

</div>

I have trouble linking both resources (\*.rc for a windows icon) as well as a manifest into my application. First i only had a manifest in which i set the DPI awareness to PerMonitor. This worked as expected: moving the …

---

## [Can't build my own project even if I specify the include directories and all the libraries](https://discourse.cmake.org/t/cant-build-my-own-project-even-if-i-specify-the-include-directories-and-all-the-libraries/10659)

<div class="topic-metadata">

**Author:** [@manuelpagliuca](https://discourse.cmake.org/u/manuelpagliuca)\
**Replies:** 0\
**Last updated:** [April 15, 2024, 12:29pm UTC](https://discourse.cmake.org/t/cant-build-my-own-project-even-if-i-specify-the-include-directories-and-all-the-libraries/10659 "2024-04-15T12:29:05Z")

</div>

Good morning, I’ve an issue with my current build, I’m also using Conan 2.2.2 and I’m attempting to use the following cmake command for generating the build: cmake -DCMAKE\_BUILD\_TYPE=Debug -DCMAKE\_TOOLCHAIN\_FILE="./cona…

---

## [Unexpected behavior of TARGET\_RUNTIME\_DLLS when mixing STATIC, SHARED, PUBLIC, PRIVATE libraries](https://discourse.cmake.org/t/unexpected-behavior-of-target-runtime-dlls-when-mixing-static-shared-public-private-libraries/10352)

<div class="topic-metadata">

**Author:** [@rkoning](https://discourse.cmake.org/u/rkoning)\
**Replies:** 2\
**Last updated:** [April 10, 2024, 10:05pm UTC](https://discourse.cmake.org/t/unexpected-behavior-of-target-runtime-dlls-when-mixing-static-shared-public-private-libraries/10352 "2024-04-10T22:05:42Z")

</div>

I’m running into some unexpected behavior when using the TARGET\_RUNTIME\_DLLS generator expression, and I’m wondering if this is something that I’m just not understand properly or if its an unhandled edge case that I shou…

---

## [CXX compiler identification is different version](https://discourse.cmake.org/t/cxx-compiler-identification-is-different-version/10268)

<div class="topic-metadata">

**Author:** [@KBOPYM](https://discourse.cmake.org/u/KBOPYM)\
**Replies:** 1\
**Last updated:** [March 2, 2024, 9:54pm UTC](https://discourse.cmake.org/t/cxx-compiler-identification-is-different-version/10268 "2024-03-02T21:54:07Z")

</div>

I had VS2022, but project was incompatible with it, so I uninstalled it and got VS2019. I assume cmake kept info of the old compilers and now fails to work -- The CXX compiler identification is MSVC 19.29.30154.0 -- Th…

---

## [MSVC\_RUNTIME\_LIBRARY completely ignored](https://discourse.cmake.org/t/msvc-runtime-library-completely-ignored/10004)

<div class="topic-metadata">

**Author:** [@StillWaters77](https://discourse.cmake.org/u/StillWaters77)\
**Replies:** 2\
**Last updated:** [March 1, 2024, 2:40pm UTC](https://discourse.cmake.org/t/msvc-runtime-library-completely-ignored/10004 "2024-03-01T14:40:03Z")

</div>

Hello, i have a weird problem with CMake and the MSVC runtime on windows. My application is statically linked against the msvc runtime, which means all libraries i am linking statically, also have to be linked against …

---

## [Comparing Visual Studio IDE default release build vs CMake default release build](https://discourse.cmake.org/t/comparing-visual-studio-ide-default-release-build-vs-cmake-default-release-build/10098)

<div class="topic-metadata">

**Author:** [@One\_Cable5781](https://discourse.cmake.org/u/One_Cable5781)\
**Replies:** 4\
**Last updated:** [February 19, 2024, 4:12am UTC](https://discourse.cmake.org/t/comparing-visual-studio-ide-default-release-build-vs-cmake-default-release-build/10098 "2024-02-19T04:12:32Z")

</div>

Hello, I am trying to transition from Visual Studio IDE’s vcxproj project files and embrace CMake. By default, Visual Studio’s release mode comes with the following settings: UseDebugLibraries false WholeProg…

---

## [source\_group Visual Studio](https://discourse.cmake.org/t/source-group-visual-studio/9990)

<div class="topic-metadata">

**Author:** [@jmigual](https://discourse.cmake.org/u/jmigual)\
**Replies:** 2\
**Last updated:** [February 3, 2024, 8:05am UTC](https://discourse.cmake.org/t/source-group-visual-studio/9990 "2024-02-03T08:05:25Z")

</div>

I am trying to use source\_group to show the files nicely in my IDE (Visual Studio 2022). The structure of my header files has some files in subfolders and others only in the include folder (sorry I can only embed one pho…

---

## [Importing C++20 module as external DLL in msvc 2022](https://discourse.cmake.org/t/importing-c-20-module-as-external-dll-in-msvc-2022/9763)

<div class="topic-metadata">

**Author:** [@forry](https://discourse.cmake.org/u/forry)\
**Replies:** 12\
**Last updated:** [January 19, 2024, 9:47pm UTC](https://discourse.cmake.org/t/importing-c-20-module-as-external-dll-in-msvc-2022/9763 "2024-01-19T21:47:56Z")

</div>

Hi, I have a testing solution done with one cmake list that simulates the creation of a module as a shared library, installing it, and then an executable that will find and consume it. Before “file sets” it worked fine.…

---

## [Cmake Mingw makefile in windows](https://discourse.cmake.org/t/cmake-mingw-makefile-in-windows/6908)

<div class="topic-metadata">

**Author:** [@Gaurav\_Tiwari](https://discourse.cmake.org/u/Gaurav_Tiwari)\
**Replies:** 4\
**Last updated:** [January 5, 2024, 4:22pm UTC](https://discourse.cmake.org/t/cmake-mingw-makefile-in-windows/6908 "2024-01-05T16:22:58Z")

</div>

I am trying to create a build of MinGW Makefiles using cmake but I get the following error when I execute the command cmake -G "MinGW Makefiles" ..\\source\\ I have added mingw bin and cmake to my path. I get the following…

---

## [Why is the default for --build different than --install?](https://discourse.cmake.org/t/why-is-the-default-for-build-different-than-install/3022)

<div class="topic-metadata">

**Author:** [@JRR](https://discourse.cmake.org/u/JRR)\
**Replies:** 3\
**Last updated:** [December 30, 2023, 5:17am UTC](https://discourse.cmake.org/t/why-is-the-default-for-build-different-than-install/3022 "2023-12-30T05:17:59Z")

</div>

I’m working on a Windows machine with Visual Studio’s compiles. I create the visual studio project/solution from a build directory using the command cmake .. When it’s time to compile I will use the command cmake -…

---

## [set\_source\_files\_properties with /Tp and /Tc](https://discourse.cmake.org/t/set-source-files-properties-with-tp-and-tc/9533)

<div class="topic-metadata">

**Author:** [@n-mam](https://discourse.cmake.org/u/n-mam)\
**Replies:** 1\
**Last updated:** [December 1, 2023, 6:06am UTC](https://discourse.cmake.org/t/set-source-files-properties-with-tp-and-tc/9533 "2023-12-01T06:06:36Z")

</div>

Hi, I am in the process of porting my project from sln to cmake and I have a situation where I need to compile 2 specific .c files as cpp. I used set\_source\_files\_properties on these 2 files like so: set\_source\_files\_p…

---

## [Get ride of \`Release\` on build path output](https://discourse.cmake.org/t/get-ride-of-release-on-build-path-output/9381)

<div class="topic-metadata">

**Author:** [@skhaz](https://discourse.cmake.org/u/skhaz)\
**Replies:** 11\
**Last updated:** [November 20, 2023, 1:33pm UTC](https://discourse.cmake.org/t/get-ride-of-release-on-build-path-output/9381 "2023-11-20T13:33:17Z")

</div>

How do I make CMake force MSVC to place the binary produced by the build in the “build” directory? I ask because for all platforms (Linux, macOS & WebAssembly) the final binary is located in build , but only on Windows …

---

## [visual studio looking for .lib](https://discourse.cmake.org/t/visual-studio-looking-for-lib/9427)

<div class="topic-metadata">

**Author:** [@superdu](https://discourse.cmake.org/u/superdu)\
**Replies:** 3\
**Last updated:** [November 14, 2023, 9:51pm UTC](https://discourse.cmake.org/t/visual-studio-looking-for-lib/9427 "2023-11-14T21:51:01Z")

</div>

Hello, I’m building my own librairy. I try to build a static and a share version (I’m using visual studio community) my structure: root | |-algos | |-src | | |\*.cpp | | | |-include | | |\*.h | | | | C…

---

## [CMake selects Visual Studio CL compiler for CUDA, despite finding nvcc?](https://discourse.cmake.org/t/cmake-selects-visual-studio-cl-compiler-for-cuda-despite-finding-nvcc/9330)

<div class="topic-metadata">

**Author:** [@errata-c](https://discourse.cmake.org/u/errata-c)\
**Replies:** 2\
**Last updated:** [November 2, 2023, 9:18pm UTC](https://discourse.cmake.org/t/cmake-selects-visual-studio-cl-compiler-for-cuda-despite-finding-nvcc/9330 "2023-11-02T21:18:29Z")

</div>

This issue is bizarre and I have no idea why it’s happening. I’m trying to compile ArrayFire from source, using vcpkg to find all the dependencies. I’ve installed all the required dependencies, and have a CUDA toolkit wi…

---

## [Migrating CMakeSettings.json over to CMakePresets.json and integrating with Linux workflow](https://discourse.cmake.org/t/migrating-cmakesettings-json-over-to-cmakepresets-json-and-integrating-with-linux-workflow/9092)

<div class="topic-metadata">

**Author:** [@TryerGit](https://discourse.cmake.org/u/TryerGit)\
**Replies:** 0\
**Last updated:** [September 26, 2023, 2:10am UTC](https://discourse.cmake.org/t/migrating-cmakesettings-json-over-to-cmakepresets-json-and-integrating-with-linux-workflow/9092 "2023-09-26T02:10:11Z")

</div>

Hello, According to official Visual Studio docs (see here), they recommend not using CMakeSettings.json but use CMakePresets.json.going forward. Visual Studio IDE (VSIDE) continues to support CMakeSettings.json as of no…

---

## [Reconciling default Visual Studio 2022 .vcxproj file vs CMake generated .vcxproj file in Release mode | x64](https://discourse.cmake.org/t/reconciling-default-visual-studio-2022-vcxproj-file-vs-cmake-generated-vcxproj-file-in-release-mode-x64/9020)

<div class="topic-metadata">

**Author:** [@TryerGit](https://discourse.cmake.org/u/TryerGit)\
**Replies:** 1\
**Last updated:** [September 24, 2023, 12:33am UTC](https://discourse.cmake.org/t/reconciling-default-visual-studio-2022-vcxproj-file-vs-cmake-generated-vcxproj-file-in-release-mode-x64/9020 "2023-09-24T00:33:43Z")

</div>

Hello, I am trying to reconcile the .vcxproj file generated by native Visual Studio for Release build x64 architecture with the equivalent file generated by CMake when the generator is set to Visual Studio. The native …

---

## [Changing target output path based on architecture](https://discourse.cmake.org/t/changing-target-output-path-based-on-architecture/8839)

<div class="topic-metadata">

**Author:** [@Saviz](https://discourse.cmake.org/u/Saviz)\
**Replies:** 3\
**Last updated:** [August 30, 2023, 11:41pm UTC](https://discourse.cmake.org/t/changing-target-output-path-based-on-architecture/8839 "2023-08-30T23:41:41Z")

</div>

Sometimes, I might need to modify the output directory based on whether my build is 32-bit or 64-bit . Currently, this is what I have in place: # Decide where to put the target based on the architecture (32/64 bit) if(…

---

## [Changing output directories](https://discourse.cmake.org/t/changing-output-directories/8829)

<div class="topic-metadata">

**Author:** [@Saviz](https://discourse.cmake.org/u/Saviz)\
**Replies:** 1\
**Last updated:** [August 28, 2023, 10:46am UTC](https://discourse.cmake.org/t/changing-output-directories/8829 "2023-08-28T10:46:35Z")

</div>

I wanted to modify the output destination for building my binaries through CMake. My objective was to organize the generation of executables, static libraries, and dynamic libraries based on architecture (64-bit/32-bit) …

---

## [link\_directories() command Adds two directories for each directory passed to it](https://discourse.cmake.org/t/link-directories-command-adds-two-directories-for-each-directory-passed-to-it/8794)

<div class="topic-metadata">

**Author:** [@Malaz99](https://discourse.cmake.org/u/Malaz99)\
**Replies:** 4\
**Last updated:** [August 22, 2023, 10:49am UTC](https://discourse.cmake.org/t/link-directories-command-adds-two-directories-for-each-directory-passed-to-it/8794 "2023-08-22T10:49:27Z")

</div>

link\_directories() command Adds two directories for each directory passed to it; one is the same as what I pass to the command and another with the appended Visual Studio $(Configuration) variable. How do I prevent that…

---

## [FetchContent base directory and CMakePresets](https://discourse.cmake.org/t/fetchcontent-base-directory-and-cmakepresets/6722)

<div class="topic-metadata">

**Author:** [@yah-nosh](https://discourse.cmake.org/u/yah-nosh)\
**Replies:** 13\
**Last updated:** [August 6, 2023, 4:08pm UTC](https://discourse.cmake.org/t/fetchcontent-base-directory-and-cmakepresets/6722 "2023-08-06T16:08:03Z")

</div>

I’m using FetchContent to manage third-party dependencies, and I ran into an issue when trying to deduplicate the sub-builds generated for different build configurations. Below is a minimal working example that replicate…

---

## [Header file of package not found.](https://discourse.cmake.org/t/header-file-of-package-not-found/8680)

<div class="topic-metadata">

**Author:** [@LucasMSpereira](https://discourse.cmake.org/u/LucasMSpereira)\
**Replies:** 2\
**Last updated:** [August 5, 2023, 12:10pm UTC](https://discourse.cmake.org/t/header-file-of-package-not-found/8680 "2023-08-05T12:10:03Z")

</div>

On windows 10 (MSVC build toolset without Visual Studio), I’m trying to build my C++ project, which uses one package (for plotting): Matplot++. I cloned it’s repo in my project’s folder. In my project’s main.cpp, I’m ab…

---

## [Why do I get "not finding compatible version with requested version ''"?](https://discourse.cmake.org/t/why-do-i-get-not-finding-compatible-version-with-requested-version/7707)

<div class="topic-metadata">

**Author:** [@theateist](https://discourse.cmake.org/u/theateist)\
**Replies:** 7\
**Last updated:** [July 1, 2023, 8:50pm UTC](https://discourse.cmake.org/t/why-do-i-get-not-finding-compatible-version-with-requested-version/7707 "2023-07-01T20:50:48Z")

</div>

I’m trying to build tesseract repo on Windows 10 22H2. I was told to use colcon to build the repo. I’m new to colcon and cmake. I cloned the repo to C:\\Temp\\colcon\_ws\\src and ran colcon build from x64 Native Tools Comma…

---

## [Inconsistent behavior of Ninja generator on first and subsequent cmake runs for CMAKE\_\<LANG\>\_STANDARD\_LIBRARIES](https://discourse.cmake.org/t/inconsistent-behavior-of-ninja-generator-on-first-and-subsequent-cmake-runs-for-cmake-lang-standard-libraries/8359)

<div class="topic-metadata">

**Author:** [@krolli](https://discourse.cmake.org/u/krolli)\
**Replies:** 5\
**Last updated:** [June 25, 2023, 7:44pm UTC](https://discourse.cmake.org/t/inconsistent-behavior-of-ninja-generator-on-first-and-subsequent-cmake-runs-for-cmake-lang-standard-libraries/8359 "2023-06-25T19:44:58Z")

</div>

Hi, we are writing a custom MSVC toolchain (specifically for Visual Studio 2017) and while doing so, we’ve run into a problem where generated build.ninja file is different on first cmake run compared to subsequent runs. …

---

## [CMAKE\_WINDOWS\_EXPORT\_ALL\_SYMBOLS exports "=="](https://discourse.cmake.org/t/cmake-windows-export-all-symbols-exports/8314)

<div class="topic-metadata">

**Author:** [@Ohjurot](https://discourse.cmake.org/u/Ohjurot)\
**Replies:** 3\
**Last updated:** [June 17, 2023, 8:58pm UTC](https://discourse.cmake.org/t/cmake-windows-export-all-symbols-exports/8314 "2023-06-17T20:58:06Z")

</div>

Hello, I’m currently migrating an Open Source lib into a package manager using CMake. During my testing, I found that CMake exports “==” to “exports.def” when using CMAKE\_WINDOWS\_EXPORT\_ALL\_SYMBOLS (Required in the cur…

---

## [Visual Studio natvis files in ITK](https://discourse.cmake.org/t/visual-studio-natvis-files-in-itk/8145)

<div class="topic-metadata">

**Author:** [@dzenanz](https://discourse.cmake.org/u/dzenanz)\
**Replies:** 5\
**Last updated:** [May 18, 2023, 12:04pm UTC](https://discourse.cmake.org/t/visual-studio-natvis-files-in-itk/8145 "2023-05-18T12:04:49Z")

</div>

I am trying to embed ITK’s natvis file in to the debug database, as per /NATVIS linker option and Add a .natvis file to a C++ project. My branch with a very small commit is here. As far as I can tell, it is not working, …

---

## [VS: Select Windows SDK version](https://discourse.cmake.org/t/vs-select-windows-sdk-version/5603)

<div class="topic-metadata">

**Author:** [@flaviu2](https://discourse.cmake.org/u/flaviu2)\
**Replies:** 8\
**Last updated:** [May 15, 2023, 9:50am UTC](https://discourse.cmake.org/t/vs-select-windows-sdk-version/5603 "2023-05-15T09:50:13Z")

</div>

I have Win10 64 bit, and VS2017. I have a CMakeLists.txt and a Makefile which looks like this: build/Makefile: CMakeLists.txt mkdir -p build; \\ cd build; \\ cmake ../ -DCMAKE\_TOOLCHAIN\_FILE=~/github/vcpkg/scripts/buil…

---

## [Building multiple WinRT executables with custom appxmanifests in one cmake script fails](https://discourse.cmake.org/t/building-multiple-winrt-executables-with-custom-appxmanifests-in-one-cmake-script-fails/7936)

<div class="topic-metadata">

**Author:** [@amaarten](https://discourse.cmake.org/u/amaarten)\
**Replies:** 1\
**Last updated:** [April 25, 2023, 8:08pm UTC](https://discourse.cmake.org/t/building-multiple-winrt-executables-with-custom-appxmanifests-in-one-cmake-script-fails/7936 "2023-04-25T20:08:23Z")

</div>

Building a project that builds multiple UWP executables with all having a custom manifest fails. Consider this cmake project that creates multiple executables, all having custom app manifests. Configuring and building …

---

## [building a shared library NMAKE : fatal error U1077](https://discourse.cmake.org/t/building-a-shared-library-nmake-fatal-error-u1077/7854)

<div class="topic-metadata">

**Author:** [@adaldev](https://discourse.cmake.org/u/adaldev)\
**Replies:** 3\
**Last updated:** [April 10, 2023, 1:49pm UTC](https://discourse.cmake.org/t/building-a-shared-library-nmake-fatal-error-u1077/7854 "2023-04-10T13:49:29Z")

</div>

Hi, I’m trying to build a simple shared library example. With the included project, I’ve got an error on build: "C:\\Program Files\\CMake\\bin\\cmake.exe" -E \_\_create\_def CMakeFiles\\TestShared.dir\\exports.def CMakeFiles\\T…

---

## [cmake error at cmake file](https://discourse.cmake.org/t/cmake-error-at-cmake-file/7790)

<div class="topic-metadata">

**Author:** [@samuelcarr](https://discourse.cmake.org/u/samuelcarr)\
**Replies:** 1\
**Last updated:** [April 3, 2023, 11:37am UTC](https://discourse.cmake.org/t/cmake-error-at-cmake-file/7790 "2023-04-03T11:37:26Z")

</div>

error is Could not find url for MSVC version = 1934 and Python version = 3.6. this is the code in question https://pastebin.com/wHzpjtGE

---

## [Trouble Linking Against Netgen](https://discourse.cmake.org/t/trouble-linking-against-netgen/7695)

<div class="topic-metadata">

**Author:** [@npss](https://discourse.cmake.org/u/npss)\
**Replies:** 1\
**Last updated:** [April 3, 2023, 11:16am UTC](https://discourse.cmake.org/t/trouble-linking-against-netgen/7695 "2023-04-03T11:16:11Z")

</div>

Hello, I am attempting to compile netgen’s nglib (GitHub - NGSolve/netgen) with OCCT for usage as a shared library on Windows. I want to be able to mesh a STEP file from within an occt based application using netgen. I …

[Previous page](https://discourse.cmake.org/tag/comp-msvc/6.md?match_all_tags=true&tags%5B%5D=comp%3Amsvc)

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