Visual Studio 2019/2022 Trouble: How to use v142 toolset specifically when both VS2022 and VS2019 are installed #30236
Replies: 2 comments 2 replies
-
|
You have to create a custom triplet and set https://learn.microsoft.com/en-us/vcpkg/users/triplets#vcpkg_platform_toolset |
Beta Was this translation helpful? Give feedback.
-
|
You might want to try explicitly telling vcpkg to use the v142 toolset through your CMakePresets.json, especially if you’re using manifest mode. By default, vcpkg tends to pick the latest installed Visual Studio toolset (usually v143), which can cause those unresolved symbol errors when your main project builds with v142. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I have been struggling to get this to work. We have a GitHub CI where we are building against the v142 and v143 toolsets. The issue is that while there is claimed compatibility between the 2 toolsets (for linking and runtime) there isn't. When we try the v142 toolset, VCPKG insists on using the v143 toolsets to build our dependencies. ITK (https://github.com/InsightSoftwareConsortium/ITK) is the main culprit at this point. When the CI gets to our compile step the compile of our code will use the v142 tool set. When the final linking is attempting I get the following error:
That comes from this run: https://github.com/BlueQuartzSoftware/complex/actions/runs/4432239443/jobs/7776058286#step:8:2293
We have a system in the office with only VS 2019 installed and the codes will compile and link correctly and without error.
I have tried a number of items in the CMakePresets.json file to communicate to VCPKG to use the VS2019 v142 tool set but nothing seems to work.
The specific PR causing this issue is at: BlueQuartzSoftware/simplnx#482
Thanks to anyone that could provide guidance.
Beta Was this translation helpful? Give feedback.
All reactions