libuv之msys2环境下编译

本文介绍了如何在MSYS2环境下编译libuv,包括MSYS2的安装注意事项、包管理器pacman的使用、mingw64工具链的安装,以及libuv的编译过程和遇到的问题。在编译libuv时,由于MSYS2对libuv的支持不足,需要在Mingw环境下进行。编译过程中可能会遇到ISO C90不支持匿名结构体的警告,可通过修改makefile将C标准更改为C11。最后,文章提到了在Windows环境下编译libuv的exe应用时,需要链接特定的Windows库,并解决printf无法输出客户端数据的问题。
摘要由CSDN通过智能技术生成

1.MSYS2是MSYS的升级版
http://www.msys2.org/
MSYS2 is a software distro and building platform for Windows
At its core is an independent rewrite of MSYS, based on modern Cygwin (POSIX compatibility layer) and MinGW-w64 with the aim of better interoperability with native Windows software. It provides a bash shell, Autotools, revision control systems and the like for building native Windows applications using MinGW-w64 toolchains.

 

It features a package management system to provide easy installation of packages, Pacman. It brings many powerful features such as dependency resolution and simple complete system upgrades, as well as straight-forward package building.

2.安装注意
1)对硬盘分区要求,系统要求
Installation restrictions:
MSYS2 can't be installed on FAT* partitions.
Current MSYS2 can't be installed on Windows XP anymore.


2)支持32和64位
Download and run the installer - "x86_64" for 64-bit, "i686" for 32-bit Windows


3)安装目录命名要求
Enter Installation Folder (ASCII, no accents, spaces nor symlinks, short path) 

3.Update the package database and core system packages with:  升级核心包
pacman -Syu
$ pacman -Syu
:: 正在同步软件包数据库...
 mingw32                  329.0 KiB   172K/s 00:02 [#####################] 100%
 mingw32.sig               96.0   B  0.00B/s 00:00 [#####################] 100%
 mingw64                  328.8 KiB  22.3K/s 00:15 [#####################] 100%
 mingw64.sig               96.0   B  0.00B/s 00:00 [#####################] 100%
 msys                     142.3 KiB  90.6K/s 00:02 [#####################] 100%
 msys.sig                  96.0   B  0.00B/s 00:00 [#####################] 100%
:: Starting core system upgrade...
警告:terminate other MSYS2 programs before proceeding
正在解决依赖关系...
正在查找软件包冲突...


软件包 (5) bash-4.4.012-1  filesystem-2017.02-4  mintty-1~2.7.3-1
           msys2-runtime-2.7.0-1  pacman-5.0.1-2


下载大小:   10.38 MiB
全部安装大小:  50.37 MiB
净更新大小:  -1.24 MiB


:: 进行安装吗? [Y/n] Y
:: 正在获取软件包......
 msys2-runtime-2.7.0...   114.1 KiB  13.1K/s 02:57 [---------------------]   4%

Note:

1) msys2的bash shell有点类似putty,选中屏幕内容即为copy到clipboard

2)有时输入pacman -Syu更新到最后失败,这个一般与国内网络有关系,但msys2更新时不止一个源,所以实际可能通过另一个源已经更新成功,下面是更新时的Log:

 libxml2-2.9.2-3-x86_64   160.3 KiB   169K/s 00:01 [#####################] 100%
错误:无法从 repo.msys2.org : Operation too slow. Less than 1 bytes/sec transfer   //从repo.msys2.org源下载失败                                                                                                                                                                                  red the last 10 seconds 获取文件 'bsdcpio-3.2.2-2-x86_64.pkg.tar.xz'
 bsdcpio-3.2.2-2-x86_64    62.4 KiB   146K/s 00:00 [#####################] 100%    //是尝试其他源下载成功的
错误:无法从 repo.msys2.org : Operation too slow. Less than 1 bytes/sec transfer                                                                                                                                                                                               red the last 10 seconds 获取文件 'bsdtar-3.2.2-2-x86_64.pkg.tar.xz'
 bsdtar-3.2.2-2-x86_64    331.5 KiB   205K/s 00:02 [#####################] 100%
 libcrypt-1.4-1

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

JXES智能生态系统

如文章对你有用,请作者喝个咖啡

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值