netease-kit / NIM_PC_Demo

云信Windows(PC) C/C++ Demo源码仓库
Other
273 stars 174 forks source link

Build with CMake Generator Visual Studio 15 2017 could not find any instance of Visual Studio. #113

Open weipingQin opened 1 month ago

weipingQin commented 1 month ago

I have installed the VS2019 in my windows environment. but when i use the Cmake command to build the project, it throw the Build with CMake Generator Visual Studio 15 2017 could not find any instance of Visual Studio. You can see the capture of the picture in the attachments . CmakeThrowthErrorNotInstanceOfVirstualStudio

nmgwddj commented 1 month ago

终端返回的错误提示已经非常非常明确了,我不知道您是否有仔细阅读终端返回的错误信息。

Visual Studio IDE 只是一个集成开发环境,它包含编译工具链和代码编辑器等一系列工具,您如果使用 Visual Studio 2019 IDE 集成开发环境却在 cmake 初始化时使用 Visual Studio 15 2017 的 generator 一定是无法找到对应的编译工具链的。

如果您期望使用 Visual Studio 15 2017 来初始化工程请至少要安装 Visual Studio 2017 Build Tools 或安装 Visual Studio 2017 IDE 集成开发环境,这样 cmake 才能正确找到 Visual Studio 15 2017 的 generator。

另外您的 cmake 初始化命令携带了 -T"v141_xp" 的 toolset 参数,这表示您在安装 Visual Studio 2017 IDE or Build Tools 时至少还需要安装 Support Windows XP (v141_xp) 组件。

如果您对 cmake 不是很了解,可参考学习 cmake cookbook 开源项目:https://github.com/dev-cafe/cmake-cookbook,这对您在未来了解和使用其他开源项目将会有很大的帮助

遇到错误时先尝试在搜索引擎或 issue 搜索,让学习更有效率,类似这种比较基础的认知问题网络上已经有大量文章和解决解决办法。

weipingQin commented 1 month ago

微软已经停止更新VS2017了你们的DEMO代码太旧了没有对最近的IDE做兼容性适配

nmgwddj commented 1 month ago

微软已经停止更新VS2017了你们的DEMO代码太旧了没有对最近的IDE做兼容性适配

的确,微软官方已经停止了 VS2017、VS2019 相关 IDE、Build Tools 在线安装程序的下载,不过您可以从一些镜像网站下载到相关旧的 Online installer,推荐您使用 MSDN itellyou 来下载:https://msdn.itellyou.cn/?lang=zh-cn

另外我们会考虑升级响应工具链到最新版本,以避免这种旧的工具链很难下载的情况,但这个时间可能不会特别及时。感谢您的反馈。