问题描述
我决定尝试CLion for Windows,它推荐MinGW或Cygwin进行编译。
我安装了软件包管理器复制到默认文件夹 C:\ msys64
中,通过运行 update-core
和 pacman -Su
。
然后下载使用 pacman -S mingw-w64-x86_64-gcc
的MinGW64程序包已放入 C:\\\\\\\\\\\\\\\\\\\\\\\\\\\ c $ c $。
问题是,
pacman -S mingw-w64-x86_64-gcc
目前正在下载版本5.0,CLion尚未支持。
MSYS2是否支持安装旧版本的软件包(MinGW版本 4.9.2
应该工作得很好)?我尝试使用 pacman -Ss mingw
搜索MinGW软件包,但该列表非常长,因为我之前没有使用过MinGW,我真的不知道该怎么做选择。
解决方案不,MSYS2不直接支持安装旧版本的软件包。以下是你可以做的一些事情:
- 看看查看您正在寻找的版本是否仍然在服务器上。它最终会被删除,但你可能会很幸运。您可以下载它,然后使用
pacman -U filename.tar.xz
安装它
- 存储库和具有所有MSYS2软件包的构建脚本,因此您可以查看其版本历史记录以查找脚本构建您感兴趣的软件包。
GCC是构建和使用的较为困难的软件包之一,因此对您来说可能很困难从源代码编译它。也要注意C ++ ABI在GCC 4和5之间改变了,所以你用旧GCC编译的二进制文件可能不适用于使用GCC 5编译的任何MSYS2 C ++共享库。
I decided to try CLion for Windows, which recommends either MinGW or Cygwin for compilation.
I installed the MSYS2 package manager into the default folder, C:\msys64
, updated it by running update-core
and pacman -Su
.
I then downloaded the MinGW64 package using pacman -S mingw-w64-x86_64-gcc
, which has been placed into C:\msys64\mingw64
.
The problem is, pacman -S mingw-w64-x86_64-gcc
currently downloads the version 5.0, which is not yet supported by CLion.
Does MSYS2 support installing older versions of packages (the MinGW version 4.9.2
should work just fine)? I tried searching for the MinGW packages using pacman -Ss mingw
, but the list is incredibly long and as I haven't worked with MinGW before, I really do not know what to choose.
解决方案 No, MSYS2 does not directly support installing old versions of packages. Here are some things you can do though:
- Look at http://repo.msys2.org/ to see if the version you are looking for happens to still be on the server. It will be deleted eventually but you might get lucky. You can download it and then install it with
pacman -U filename.tar.xz
- The repositories https://github.com/Alexpux/MINGW-packages and https://github.com/Alexpux/MSYS2-packages have the build scripts for all the MSYS2 packages so you could look in their version history to find the script for building the package you are interested in.
GCC is one of the harder packages to build and work with so it might be difficult for you to compile it from source. Also beware that the C++ ABI changed between GCC 4 and 5 or something like that, so binaries you build with the old GCC might not work with any of the MSYS2 C++ shared libraries compiled with GCC 5.
这篇关于如何使用MSYS2获取旧版本的软件包?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!