mingw-w64 - 将 MSYS2 降级到特定的 Mingw / gcc 版本
问题描述
我的系统中安装了 MSYS2 64 位。当我尝试检查 gcc 版本时,我得到以下输出。
$ gcc --version
gcc.exe (Rev9, Built by MSYS2 project) 10.2.0
Copyright (C) 2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
但我想为使用 qt 库的项目使用特定的 mingw 版本。当我检查我的 qt 项目的构建日志和安装文件夹时,我发现了这个。
|Project name: DataManager
|Project version: undefined
|C++ compiler for the host machine: ccache c++ (gcc 4.9.2 "c++ (i686-posix-dwarf-rev1, Built by MinGW-W64 project) 4.9.2")
|C++ linker for the host machine: c++ ld.bfd 2.24
|Program python3 found: YES
|Found qmake: C:\Qt\5.6.3\mingw49_32\bin\qmake.EXE (5.6.3)
我假设它使用 mingw49_32 版本和 gcc 版本 4.9.2。我想在 MSYS2 中使用相同的 gcc 版本(4.9.2)。
我怎样才能实现它?
解决方案
你不能用 MSYS2 做到这一点。旧包最终会从 MSYS2 存储库中删除,所以即使它在过去的某个时候有 GCC 4.9,它也不再有。最早可用的版本是 GCC 9.3。
即使它在 repo 中,您也必须手动下载并安装它及其所有依赖项,因为无法直接从pacman
.
但是,我怀疑:
- 您已经在
C:\Qt\5.6.3\mingw49_32\bin
. - 即使您不这样做,您也可以使用最新的 GCC。
推荐阅读
- c# - 在字典中查找蒙古语
- c# - 在 OWIN 中记录 JWT Bearer 身份验证和验证
- r - data.table 中的函数,具有两列作为参数
- android - System.exit() 之后是否有任何 android 服务回调函数被调用?
- python - Django 按类别查看帖子
- maven - gradle依赖失败但它在那里
- javascript - 无法使用 Promise、catch 和 gulp 将文件写入 dist 文件夹
- javascript - 如何从数据库中返回数据?
- javascript - ApexChart TypeError:更新图表时“c未定义”
- python - pandas 数据集转换以规范化数据