一、前言
? ? ? ? 最近在開發過程中編譯使用Cuda的版本較低,導致與最新的Visual Studio Community 2022 17.14.8不兼容。編譯報錯如下:
[cmake] C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.44.35207\include\yvals_core.h(902): error : static assertion failed with "error STL1002: Unexpected compiler version, expected CUDA 12.4 or newer."
因為我當前Cuda版本不好升級,所以只能退而求其次,降低Visual Studio Community 2022的版本;之前使用的低版本17.7.6版本編譯沒有問題,這里想找到對應低版本的安裝包。官網找了半天沒有找到,最終,找到通過命令的方式安裝低版本的VS;
二、前期準備
1、卸載已經安裝的vs環境,控制面板->卸載程序,找到相關的VS安裝程序卸載了;
三、安裝下載指定安裝包?
1、打開 powershell, 管理員身份運行
2、輸入安裝下載命令:
winget install -v 17.7.6 "Microsoft.VisualStudio.2022.Community"
?后續下載指定版本只需要修改 版本號,本文中下載17.7.6
?