一、前言
最近在开发过程中编译使用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、输入安装下载命令:
bash
winget install -v 17.7.6 "Microsoft.VisualStudio.2022.Community"
后续下载指定版本只需要修改 版本号,本文中下载17.7.6

