如何使用 MSYS2 编译最新版的 coreutils 源码(目前最新版本为 coreutils-9.4)

2023-11-01

上一篇文章总结了:MSYS2 介绍、下载与安装、Pacman常用命令

本文将演示如何使用 MSYS2 编译 coreutils 源码。

一、coreutils 源码下载

官网镜像仓库:Index of /gnu/coreutils
Github 仓库:coreutils/coreutils/tags
这里下载目前最新版本:coreutils-9.4.tar.gz

虽然但是我还是要提一下:MSYS2 安装完成后,默认会安装coreutils软件包,版本为 8.32

Administrator@GC MSYS ~
$ pacman -Qs coreutils
local/coreutils 8.32-5
    The basic file, shell and text manipulation utilities of the GNU operating system

一般情况下也没必要使用最新版,这里仅是为了演示如何使用MSYS2编译项目,所以就拿coreutils试试。

二、MSYS2 安装编译工具

使用 MSYS 环境进行编译 coreutils

1. pacman -Suy 更新软件仓库

Administrator@GC MSYS ~
$ pacman -Suy
:: Synchronizing package databases...
 clangarm64 is up to date
 mingw32 is up to date
 mingw64 is up to date
 ucrt64 is up to date
 clang32 is up to date
 clang64 is up to date
 msys is up to date
:: Starting core system upgrade...
 there is nothing to do
:: Starting full system upgrade...
 there is nothing to do

我这里已经是最新了。

2. pacman -S msys/gcc 安装gcc

Administrator@GC MSYS ~
$ pacman -S msys/gcc
resolving dependencies...
looking for conflicting packages...

Packages (8) binutils-2.41-2  isl-0.26-1  mpc-1.3.1-1  msys2-runtime-devel-3.4.8-1
             msys2-w32api-headers-11.0.1.r0.gc3e587c06-1
             msys2-w32api-runtime-11.0.1.r0.gc3e587c06-1  windows-default-manifest-6.4-1
             gcc-11.3.0-4

Total Download Size:    41.38 MiB
Total Installed Size:  318.84 MiB

:: Proceed with installation? [Y/n] y
:: Retrieving packages...
 isl-0.26-1-x86_64               745.0 KiB   260 KiB/s 00:03 [###############################] 100%
 msys2-w32api-headers-11.0....     5.2 MiB  1131 KiB/s 00:05 [###############################] 100%
 mpc-1.3.1-1-x86_64               78.5 KiB   147 KiB/s 00:01 [###############################] 100%
 binutils-2.41-2-x86_64            5.4 MiB   979 KiB/s 00:06 [###############################] 100%
 windows-default-manifest-6...  1388.0   B  3.45 KiB/s 00:00 [###############################] 100%
 msys2-runtime-devel-3.4.8-...   338.8 KiB  68.2 KiB/s 00:05 [###############################] 100%
 gcc-11.3.0-4-x86_64              27.6 MiB  2.63 MiB/s 00:10 [###############################] 100%
 msys2-w32api-runtime-11.0....     2.0 MiB   194 KiB/s 00:11 [###############################] 100%
 Total (8/8)                      41.4 MiB  3.86 MiB/s 00:11 [###############################] 100%
(8/8) checking keys in keyring                               [###############################] 100%
(8/8) checking package integrity                             [###############################] 100%
(8/8) loading package files                                  [###############################] 100%
(8/8) checking for file conflicts                            [###############################] 100%
(8/8) checking available disk space                          [###############################] 100%
:: Processing package changes...
(1/8) installing binutils                                    [###############################] 100%
(2/8) installing isl                                         [###############################] 100%
(3/8) installing mpc                                         [###############################] 100%
(4/8) installing msys2-runtime-devel                         [###############################] 100%
(5/8) installing msys2-w32api-headers                        [###############################] 100%
(6/8) installing msys2-w32api-runtime                        [###############################] 100%
(7/8) installing windows-default-manifest                    [###############################] 100%
(8/8) installing gcc                                         [###############################] 100%
:: Running post-transaction hooks...
(1/1) Updating the info directory file...

3. pacman -S msys/make 安装make工具

Administrator@GC MSYS ~
$ pacman -S msys/make
resolving dependencies...
looking for conflicting packages...

Packages (1) make-4.4.1-1

Total Download Size:   0.49 MiB
Total Installed Size:  1.61 MiB

:: Proceed with installation? [Y/n] y
:: Retrieving packages...
 make-4.4.1-1-x86_64             505.9 KiB   129 KiB/s 00:04 [###############################] 100%
(1/1) checking keys in keyring                               [###############################] 100%
(1/1) checking package integrity                             [###############################] 100%
(1/1) loading package files                                  [###############################] 100%
(1/1) checking for file conflicts                            [###############################] 100%
(1/1) checking available disk space                          [###############################] 100%
:: Processing package changes...
(1/1) installing make                                        [###############################] 100%
:: Running post-transaction hooks...
(1/1) Updating the info directory file...

4. 解压缩 coreutils 压缩包

Administrator@GC MSYS ~
$ cd C:/Chen/Mytools/

Administrator@GC MSYS /c/Chen/Mytools
$ tar -xzf coreutils-9.4.tar.gz coreutils-9.4/

Administrator@GC MSYS /c/Chen/Mytools
$ cd coreutils-9.4

Administrator@GC MSYS /c/Chen/Mytools/coreutils-9.4
$

5. 执行 ./configure 命令

在解压后的coreutils-9.4根目录下,执行.configure命令,将生成Makefile文件。
这个可能需要执行数十分钟。

Administrator@GC MSYS /c/Chen/Mytools/coreutils-9.4
$ ./configure
configure: loading site script /etc/config.site
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a race-free mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
...
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating po/Makefile.in
config.status: creating gnulib-tests/Makefile
config.status: creating lib/config.h
config.status: executing depfiles commands
config.status: executing po-directories commands
config.status: creating po/POTFILES
config.status: creating po/Makefile

Administrator@GC MSYS /c/Chen/Mytools/coreutils-9.4
$

6. 执行 make 进行编译(cygwin-3.4.8版本的一个bug导致的报错)

Administrator@GC MSYS /c/Chen/Mytools/coreutils-9.4
$ make
  GEN      lib/alloca.h
  GEN      lib/arpa/inet.h
  GEN      lib/configmake.h
  GEN      lib/ctype.h
  GEN      lib/dirent.h
  GEN      lib/error.h
  ...
  In file included from /usr/include/sys/signal.h:23,
                 from /usr/include/signal.h:6,
                 from ./lib/signal.h:52,
                 from /usr/include/time.h:158,
                 from ./lib/time.h:54,
                 from ./lib/sys/stat.h:51,
                 from ./lib/fcntl.h:64,
                 from ./lib/unistd.h:105,
                 from ./lib/stdlib.h:104,
                 from /usr/include/sys/cpuset.h:12,
                 from /usr/include/sys/_pthreadtypes.h:12,
                 from /usr/include/sys/types.h:221,
                 from ./lib/sys/types.h:46,
                 from ./lib/stdio.h:75,
                 from lib/long-options.c:27:
/usr/include/cygwin/signal.h:121:3: error: unknown type name 'pthread_attr_t'
  121 |   pthread_attr_t *sigev_notify_attributes; /* notification attributes */
      |   ^~~~~~~~~~~~~~
In file included from /usr/include/signal.h:6,
                 from ./lib/signal.h:52,
                 from /usr/include/time.h:158,
                 from ./lib/time.h:54,
                 from ./lib/sys/stat.h:51,
                 from ./lib/fcntl.h:64,
                 from ./lib/unistd.h:105,
                 from ./lib/stdlib.h:104,
                 from /usr/include/sys/cpuset.h:12,
                 from /usr/include/sys/_pthreadtypes.h:12,
                 from /usr/include/sys/types.h:221,
                 from ./lib/sys/types.h:46,
                 from ./lib/stdio.h:75,
                 from lib/long-options.c:27:
/usr/include/sys/signal.h:227:29: error: expected ')' before 'int'
  227 | int pthread_kill (pthread_t, int);
      |                             ^~~~
      |                             )
In file included from /usr/include/sys/stat.h:22,
                 from ./lib/sys/stat.h:54,
                 from ./lib/fcntl.h:64,
                 from ./lib/unistd.h:105,
                 from ./lib/stdlib.h:104,
                 from /usr/include/sys/cpuset.h:12,
                 from /usr/include/sys/_pthreadtypes.h:12,
                 from /usr/include/sys/types.h:221,
                 from ./lib/sys/types.h:46,
                 from ./lib/stdio.h:75,
                 from lib/long-options.c:27:
/usr/include/cygwin/stat.h:27:3: error: unknown type name 'timestruc_t'
   27 |   timestruc_t   st_atim;
      |   ^~~~~~~~~~~
/usr/include/cygwin/stat.h:28:3: error: unknown type name 'timestruc_t'
   28 |   timestruc_t   st_mtim;
      |   ^~~~~~~~~~~
/usr/include/cygwin/stat.h:29:3: error: unknown type name 'timestruc_t'
   29 |   timestruc_t   st_ctim;
      |   ^~~~~~~~~~~
/usr/include/cygwin/stat.h:32:3: error: unknown type name 'timestruc_t'
   32 |   timestruc_t   st_birthtim;
      |   ^~~~~~~~~~~
  CC       lib/libcoreutils_a-mbrlen.o
make[2]: *** [Makefile:15547: lib/libcoreutils_a-long-options.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: Leaving directory '/c/Chen/Mytools/coreutils-9.4'
make[1]: *** [Makefile:22396: all-recursive] Error 1
make[1]: Leaving directory '/c/Chen/Mytools/coreutils-9.4'
make: *** [Makefile:8835: all] Error 2

我这里执行make后有报错(见上述示例),这个错误困扰我两天了,在网上查阅了多资料,最终在 can’t compile coreutils-9.3 any more after upgrade to cygwin-3.4.8 找到了原因。原因是这个问题是cygwin-3.4.8版本的一个bug,而我的MSYS2依赖的刚好是cygwin-3.4.8版本,真的是好巧不巧。。。

MSYS2中依赖的cygwin,对应的是 msys2-runtimemsys2-runtime-devel 软件包。

Administrator@GC MSYS ~
$ pacman -Qs msys2-runtime
local/msys2-runtime 3.4.8-1
    Posix emulation engine for Windows
local/msys2-runtime-devel 3.4.8-1
    MSYS2 headers and libraries

另外写这篇文章的前一天,cygwin官网已经修复了这个问题,在cygwin-3.4.9版本。
cygwin/cygwin/tree/cygwin-3.4.9
cygwin/cygwin/compare/cygwin-3.4.7…cygwin-3.4.8
cygwin/cygwin/compare/cygwin-3.4.8…cygwin-3.4.9
cygwin 3.4.9-1 问题修复

msys2/msys2-rumtime 仓库也同步了 cygwin-3.4.9 版本:
msys2/msys2-runtime
msys2/msys2-runtime/compare/cygwin-3.4.8…cygwin-3.4.9

msys2/MSYS2-packages 软件包代码仓库也同步了 msys2-runtime 为 3.4.9 版本:
msys2/MSYS2-packages
msys2/MSYS2-packages/tree/master/msys2-runtime

在这里插入图片描述
但是有个问题是,MSYS2 软件仓库的msys2-runtimemsys2-runtime-devel目前仍是 3.4.8 版本,比源码要落后(具体什么时候更新到3.4.9,我也不清楚)。
https://mirror.umd.edu/msys2/msys/x86_64/
在这里插入图片描述
也就是说目前,无法通过 pacman -Syu msys2-runtime 更新到3.4.9版本。
当然你可以自己编译最新版本,然后通过pacman -U <本地软件包>进行安装,可参考:Creating Packages

自己编译还是有些麻烦的,这里找到了一种简便方法供参考:
方案:修改 /usr/include/sys/cpuset.h文件
MSYS2安装路径usr/include/sys/目录下,找到cpuset.h文件(前提是已安装了msys2-runtime-devel,安装gcc时会自动安装这个)

将文件中的#include <stdlib.h>#include <string.h> 注释掉。
在这里插入图片描述

7. 重新执行 make 进行编译(因为一些依赖包未安装,仍报错)

修改完上述的问题后,(先执行下make clean),重新执行make命令,又遇到了如下报错。

In file included from src/system.h:172,
                 from src/chroot.c:26:
./lib/gettext.h:26:11: fatal error: libintl.h: No such file or directory
   26 | # include <libintl.h>
      |           ^~~~~~~~~~~
compilation terminated.
make[2]: *** [Makefile:12465: src/chroot.o] Error 1
make[2]: Leaving directory '/c/Chen/Mytools/coreutils-9.4'
make[1]: *** [Makefile:22396: all-recursive] Error 1
make[1]: Leaving directory '/c/Chen/Mytools/coreutils-9.4'
make: *** [Makefile:8835: all] Error 2

这个报错也困扰我了好久,因为我不知道编译 coreutils 都需要哪些依赖。后来通过
Package: coreutils | MSYS2 Packages 找到了MSYS2官网在构建coreutils-8.32时依赖项

在这里插入图片描述

啥也别说了,把这些依赖项都安装上吧。
(有些我已经装过了,我这里通过 pacman -Qs 查看,autotools gmp-devel help2man还没有装)

Administrator@GC MSYS ~
$ pacman -S autotools gmp-devel help2man

8. 再次执行 make 进行编译(成功)

安装完依赖软件包后,(先执行下make clean),再次执行make命令。
这次很顺利,编译生成了Windows可执行的exe实用程序

Administrator@GC MSYS /c/Chen/Mytools/coreutils-9.4/
$ make -j4
...

Administrator@GC MSYS /c/Chen/Mytools/coreutils-9.4
$ ls src/*.exe
'src/[.exe'          src/expr.exe              src/nproc.exe       src/stat.exe
 src/b2sum.exe       src/factor.exe            src/numfmt.exe      src/stty.exe
 src/base32.exe      src/false.exe             src/od.exe          src/sum.exe
 src/base64.exe      src/fmt.exe               src/paste.exe       src/sync.exe
 src/basename.exe    src/fold.exe              src/pathchk.exe     src/tac.exe
 src/basenc.exe      src/getlimits.exe         src/pinky.exe       src/tail.exe
 src/cat.exe         src/ginstall.exe          src/pr.exe          src/tee.exe
 src/chcon.exe       src/groups.exe            src/printenv.exe    src/test.exe
 src/chgrp.exe       src/head.exe              src/printf.exe      src/timeout.exe
 src/chmod.exe       src/hostid.exe            src/ptx.exe         src/touch.exe
 src/chown.exe       src/id.exe                src/pwd.exe         src/tr.exe
 src/chroot.exe      src/join.exe              src/readlink.exe    src/true.exe
 src/cksum.exe       src/kill.exe              src/realpath.exe    src/truncate.exe
 src/comm.exe        src/link.exe              src/rm.exe          src/tsort.exe
 src/cp.exe          src/ln.exe                src/rmdir.exe       src/tty.exe
 src/csplit.exe      src/logname.exe           src/runcon.exe      src/uname.exe
 src/cut.exe         src/ls.exe                src/seq.exe         src/unexpand.exe
 src/date.exe        src/make-prime-list.exe   src/sha1sum.exe     src/uniq.exe
 src/dd.exe          src/md5sum.exe            src/sha224sum.exe   src/unlink.exe
 src/df.exe          src/mkdir.exe             src/sha256sum.exe   src/uptime.exe
 src/dir.exe         src/mkfifo.exe            src/sha384sum.exe   src/users.exe
 src/dircolors.exe   src/mknod.exe             src/sha512sum.exe   src/vdir.exe
 src/dirname.exe     src/mktemp.exe            src/shred.exe       src/wc.exe
 src/du.exe          src/mv.exe                src/shuf.exe        src/who.exe
 src/echo.exe        src/nice.exe              src/sleep.exe       src/whoami.exe
 src/env.exe         src/nl.exe                src/sort.exe        src/yes.exe
 src/expand.exe      src/nohup.exe             src/split.exe

9. 打包生成的可执行程序

执行make install命令,打包编译生成的可执行程序。
需要注意的是,在执行 make install 命令时,要以 root 用户或者使用 sudo 命令来执行,以便拥有足够的权限进行安装。

说明:
我这里不想改动MSYS2自带的coreutils-8.32-5版本,所以就不执行make install了。因为前面我在执行./configure 时忘记添加 --prefix 参数指定安装路径了,所以这里手动搞一下。

Administrator@GC MSYS /c/Chen/Mytools/coreutils-9.4
$ mkdir bin

Administrator@GC MSYS /c/Chen/Mytools/coreutils-9.4
$ cp src/*.exe bin

Administrator@GC MSYS /c/Chen/Mytools/coreutils-9.4
$ cp /usr/bin/msys-2.0.dll bin

注意:通过MSYS2编译的exe程序,依赖msys-2.0.dll库,因此在脱离MSYS2环境使用时,需要将msys-2.0.dll一并打包。

10. 测试 coreutils 工具包中的实用程序

Administrator@GC MSYS /c/Chen/Mytools/coreutils-9.4/bin
$ expr --version
expr (GNU coreutils) 8.32
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Mike Parker, James Youngman, and Paul Eggert.

Administrator@GC MSYS /c/Chen/Mytools/coreutils-9.4/bin
$ cmd
Microsoft Windows [版本 10.0.19045.3208]
(c) Microsoft Corporation。保留所有权利。

C:\Chen\Mytools\coreutils-9.4\bin>expr --version
expr (GNU coreutils) 9.4
Copyright (C) 2023 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Mike Parker, James Youngman, and Paul Eggert.

C:\Chen\Mytools\coreutils-9.4\bin>expr ( 2 + 6 )
8

C:\Chen\Mytools\coreutils-9.4\bin>ls | grep 'whoami'
whoami.exe

C:\Chen\Mytools\coreutils-9.4\bin>whoami
Administrator

C:\Chen\Mytools\coreutils-9.4\bin>

注意:
因为我没有在MSYS环境安装最新版本的coreutils,所以在MSYS环境下仍是自带的coreutils-8.32版本。通过cmd命令,切换出MSYS环境,进行了如上验证。可以看到最新编译的coreutils-9.4版本中的expr、ls、grep、whoami命令可以正常使用。
完美~
另外可以将C:\Chen\Mytools\coreutils-9.4\bin> 添加到环境变量PATH中,这样就可以在cmd、powershell 的任何工作路径下使用新编译的coreutils工具包中的命令了(这里就不演示了)

三、最后&总结

最后,在我即将发布这篇文章的时候,我又看了一眼 MSYS2 软件包仓库的msys2-runtime、msys2-runtime-devel版本,已经更新到了 3.4.9 ,所以你们是幸福的,直接更新到 3.4.9 ,就不会遇到我前面遇到的第一个问题了。

Administrator@GC MSYS ~
$ pacman -Syu
:: Synchronizing package databases...
 clangarm64                                                                            1728.7 KiB   787 KiB/s 00:02 [####################################################################] 100%
 mingw32                                                                               1803.3 KiB  1088 KiB/s 00:02 [####################################################################] 100%
 mingw64                                                                               1944.2 KiB   921 KiB/s 00:02 [####################################################################] 100%
 ucrt64                                                                                1984.0 KiB   731 KiB/s 00:03 [####################################################################] 100%
 clang32                                                                               1781.6 KiB   838 KiB/s 00:02 [####################################################################] 100%
 clang64                                                                               1940.5 KiB  2.31 MiB/s 00:01 [####################################################################] 100%
 msys                                                                                   460.5 KiB   540 KiB/s 00:01 [####################################################################] 100%
:: Starting core system upgrade...
warning: terminate other MSYS2 programs before proceeding
resolving dependencies...
looking for conflicting packages...

Packages (2) msys2-runtime-3.4.9-1  msys2-runtime-devel-3.4.9-1

Total Download Size:    2.12 MiB
Total Installed Size:  10.08 MiB
Net Upgrade Size:       0.00 MiB

:: Proceed with installation? [Y/n] y
:: Retrieving packages...
 msys2-runtime-devel-3.4.9-1-x86_64                                                     338.9 KiB   664 KiB/s 00:01 [####################################################################] 100%
 msys2-runtime-3.4.9-1-x86_64                                                          1834.9 KiB  3.22 MiB/s 00:01 [####################################################################] 100%
 Total (2/2)                                                                              2.1 MiB  3.60 MiB/s 00:01 [####################################################################] 100%
(2/2) checking keys in keyring                                                                                      [####################################################################] 100%
(2/2) checking package integrity                                                                                    [####################################################################] 100%
(2/2) loading package files                                                                                         [####################################################################] 100%
(2/2) checking for file conflicts                                                                                   [####################################################################] 100%
(2/2) checking available disk space                                                                                 [####################################################################] 100%
:: Processing package changes...
(1/2) upgrading msys2-runtime                                                                                       [####################################################################] 100%
(2/2) upgrading msys2-runtime-devel                                                                                 [####################################################################] 100%
:: To complete this update all MSYS2 processes including this terminal will be closed. Confirm to proceed [Y/n]

最后总结:
在编译coreutils-9.4的过程中,虽然遇到了问题,中途几次都想放弃,但是最终还是找到了解决方案,在解决问题的过程中,收获蛮多的。比如:

  • 更切实的理解了,MSYS2 底层依赖了 Cygwin,对应的是 msys2-runtime、msys2-runtime-devel 包;
  • 可通过 https://packages.msys2.org/updates 查看软件包的详细信息,比如上述 coreutils 构建时依赖有哪些依赖,就是通过这个网站查到的。package/coreutils
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

如何使用 MSYS2 编译最新版的 coreutils 源码(目前最新版本为 coreutils-9.4) 的相关文章

  • Git Commit 使用了错误的时区

    通常我使用两台电脑 例如 PC1 and PC2 我在两者上都使用CygWin on Windows 10 他们有相同的配置 On PC1我试图对如何显示日期和时间进行一些调整 git log 我尝试了多个bash and git命令 过去
  • cygwin下无法访问jarfile

    我知道这里有很多 无法访问 jarfile 问题 但我确实觉得这足以保证它自己的线程 我正在编写一个演练 该演练的一部分涉及安装 Cygwin 并运行 jar 文件 问题是这个 jar 文件需要从多个目录调用 而不是让我的读者每次需要运行它
  • Node.js 找不到模块 - 干扰 Windows 上的 cygwin

    我正在测试 Bootstrap 框架 来自 Twitter 并尝试在安装 Node js 后在本地构建它 它失败了 因为它找不到 less 模块 我也使用 npm install g less 安装了该模块 C Users geir cod
  • Windows 中的 Nutch:无法设置路径权限

    我尝试在 Windows 计算机上使用 Solr 和 Nutch 但收到以下错误 Exception in thread main java io IOException Failed to set permissions of path
  • /usr/local/bin:/usr/bin: 到 $PATH 的末尾而不是顶部

    我正在尝试使用 MSVC 链接器进行 ICU 代码 但是 启动 Cygwin 会将 usr local bin 和 usr bin 放在路径前面 导致 link exe 始终调用 Cygwin 版本 而不是 MSVC 版本 我该如何解决这个
  • MinGW 作为可靠的 64 位 GCC 编译器

    我担心 64 位 MinGW 编译器作为 Visual C 编译器的替代品的可靠性 例如 假设 C 代码使用 GCC 4 6 2 在 Linux 下完美构建和运行 相应的 MinGW 是否会在 64 位 Windows 下生成类似可靠的可执
  • cygwin g++ std::stoi“错误:‘stoi’不是‘std’的成员

    I have Windows 7 32 位上的 cygwin 1 7 25 g 版本 gt g GCC 4 8 2 libstdc a gt gcc g 4 8 2 1 试图制作一个c 你好世界 include
  • 在 cygwin 上编译 android boost 时无法识别的命令行选项

    我正在尝试在 cygwin 的帮助下编译 boost以下文章 http www codexperiments com android 2011 05 tips tricks building boost with ndk r5 但是当我运行
  • 在 Cygwin 中启用 Postgresql

    我安装了Cygwin与 Perl 和Postgresql已启用软件包 然后输入 usr bin cygserver config This will install the service 然后输入 net start cygserver
  • bash:ssh-host-config:找不到命令

    有谁有任何想法可能导致此问题 我使用的是 win 7 我已经使用本教程成功设置了所有内容 http www kgx net nz 2010 03 cygwin sshd and windows 7 http www kgx net nz 2
  • 解决 emacs 错误的想法:“应用:生成子进程:exec 格式错误”

    我正在尝试将 rdebug 与 emacs 和 cygwin 一起使用 但遇到了麻烦 每当我执行 M x rdebug 并为其提供适当的脚本来运行时 它都会因错误而停止 apply Spawning child process exec f
  • 安装 Sass 时出错(Ruby 2.5.0.1、MSYS2 20161025.0.0)

    我尝试安装 Sass 我安装了Ruby and MSYS2在此之前 来自所有人的最新消息巧克力味 https chocolatey org choco install ruby choco install msys2 看来它们已正确安装 r
  • 自定义 SSH 端口上的 Git

    我的 VPS 提供商建议我将 SSH 端口保留为他们默认分配的自定义端口号 不是 22 问题是 虽然我知道我可以在创建远程配置时提供端口号 但在进行 Git 克隆时似乎无法提供相同的操作 我在用gitolite https wiki arc
  • adb shell:无法使用 ESCAPE 键

    I want to use vi when running adb shell Starting vi is easy However I found that the ESC key doesn t seem to get through
  • 作曲家和 Cygwin

    如果您尝试 全局 安装 Composer 则 Composer 无法在 Cygwin 中正确运行 将composer phar放入 usr local bin composer 然后尝试运行它会导致错误 Could not open inp
  • 将 SWI Prolog 代码编译为 Windows 可执行文件 - 解析器 Grails3 项目

    我正在尝试构建解析器 Grails3 项目https github com RichardMoot Grail https github com RichardMoot Grail谁的教程是http www labri fr perso m
  • 使用 CLion 进行 OpenCV Windows 设置

    我想在 Windows 上为 CLion IDE 设置 OpenCV 我尝试使用 OpenCV 3 1 和 2 4 得到相同的结果 我有 Windows 10 64 位 CLion 使用 cygwin 环境 到目前为止我做了什么 1 从Op
  • 未创建 .ssh 目录

    生成 sshdir 我使用这个命令 ssh keygen 摘自本教程 http ebiquity umbc edu Tutorials Hadoop 05 20 20Setup 20SSHD html http ebiquity umbc
  • 使用 Cygwin64 的 Fortran MPI

    我正在使用 Codeblock IDE 编写和编译我的 Fortran 程序 现在我想将 MPI 包含到我的 GNU Fortran 编译器中 在遵循 GNU GCC 编译器的一些指南之后 我突然想到我需要为 MPICH2 设置以下内容 有
  • 在 Cygwin 软件包列表中找不到 Openssl

    这里说的是https github com joyent node wiki Building node js on Cygwin Windows https github com joyent node wiki Building nod

随机推荐

  • 03.前后端分离中台框架 zhontai 项目代码生成器的使用

    zhontai 项目 基于 Net7 x Vue 等技术的前后端分离后台权限管理系统 想你所想的开发理念 希望减少工作量 帮助大家实现快速开发 后端地址 https github com zhontai Admin Core 前端地址 ht
  • flutter实现APP版本更新(全局弹窗overlay实现)

    升级说明 Android 应用内更新下载 安装 iOS 跳转到appstore下载安装 注 可以通过热更新技术进行升级 我不会 引用插件 获取当前版本 package info 0 4 3 2 版本内更新 ota update 2 4 1
  • Mac下终端(Terminal)中打开某应用的技巧

    Mac下一般都是点击某一个应用的图标 或者在Alfred中键入应用名称打开该应用 但有时候在终端执行某些代码 此时想打开程序 以上操作都不流畅 所以琢磨能否在终端下直接打开某些程序 比如要 编辑路径下的shell脚本文件 但又不想使用vim
  • 基于Stable Diffusion的AIGC服饰穿搭实践

    本文主要介绍了基于Stable Diffusion技术的虚拟穿搭试衣的研究探索工作 文章展示了使用LoRA ControlNet Inpainting SAM等工具的方法和处理流程 并陈述了部分目前的实践结果 通过阅读这篇文章 读者可以了解
  • python爬虫学习笔记-requests高级

    简历模板下载拓展 import requests from lxml import etree import os headers User Agent Mozilla 5 0 Macintosh Intel Mac OS X 10 15
  • http与websocket

    http与websocket HTTP 是一个在计算机世界里专门在两点之间传输文字 图片 音频 视频等超文本数据的约定和规范 WebSocket是HTML5出的东西 协议 也就是说HTTP协议没有变化 或者说没关系 但HTTP是不支持持久连
  • 小程序中使用CANVAS实现手写签名并写入模板图片中

    实测 开发者工具中滚动条位置会影响书写 显示会有些问题 并且会卡顿 安卓 苹果手机上测试正常 index js const App getApp Page 页面的初始数据 data curScrollTop 0 生命周期函数 监听页面加载
  • python计时模块——timeit

    timeit模块 timeit 模块定义了接受两个参数的 Timer 类 两个参数都是字符串 第一个参数是你要计时的语句或者函数 传递给 Timer 的第二个参数是为第一个参数语句构建环境的导入语句 从内部讲 timeit 构建起一个独立的
  • PWM驱动MOS管H桥电路分析

    H桥是一个典型的直流电机控制电路 因为它的电路形状酷似字母H 故得名与 H桥 4个三极管组成H的4条垂直腿 而电机就是H中的横杠 注意 图中只是简略示意图 而不是完整的电路图 其中三极管的驱动电路没有画出来 01 H桥驱动原理 1 电机驱动
  • 网络安全-文件包含漏洞原理、攻击及防御

    目录 简介 类型 原理 攻击 仅本地文件包含 防御 简介 文件包含 是一个功能 在各种开发语言中都提供了内置的文件包含函数 可以使开发人员在一个代码文件中直接包含 引入 另外一个代码文件 类型 根据不同的配置环境 文件包含漏洞分为如下两种情
  • Qt - QLabel设置字体颜色

    Qt QLabel设置字体颜色 第一种 使用setPalette 方法如下 QLabel label new QLabel tr Hello Qt QPalette pe pe setColor QPalette WindowText Qt
  • 等级保护2.0四级通用要求测评方法

    等级保护2 0四级通用要求测评方法
  • Python 使用 smtp ssl 模式 发送邮件与附件

    参考 发送邮件简单入门 以qq邮箱 163邮箱为例 https blog csdn net qq 38661599 article details 81013834 smtp ssl 模式 发送邮件 与 附件 https www cnblo
  • Vue-组件之间的的数据传递

    目录 组件的使用 注册全局组件 props组件 组件之间样式冲突问题 父 子关系传递 子 父关系传递 兄弟之间的传递 ref引用 什么是组件 只要是 vue后缀的文件都是一个组件 而组件之间是独立的 相互之间没有关系 当在使用组件的时候 根
  • 数据库 数据结构设计实验报告 包括er图转关系模式

    年级 班号 组号 学号 专业 日期 姓名 实验名称 实验一 数据库设计 实验室 实验 目的 或 要求 1 通过了解具体的应用案例体验数据库的应用 以及数据库系统和应用程序之间的关联关系 从而进一步理解数据 数据库 DBMS基本概念知识 2
  • chatgpt赋能python:如何利用Python绘制窗口

    如何利用Python绘制窗口 作为一门高级编程语言 Python具备强大的绘图能力 可以用来创建各种窗口应用程序 本篇文章将介绍如何利用Python绘制窗口 并分析其在搜索引擎优化方面的作用 绘制窗口的基本步骤 要利用Python绘制窗口
  • 测试-python筑基1.1-(列表/元组/字典/集合/字符串)

    列表 列表 列表 一种将多个数据组合到一起的容器 标识符 关键字 list 给列表赋值变量名的时候 不要用关键字 list 1 定义一个空列表 list 2 1 2 3 4 5 定义一个有值的列表 不是数组 print type list
  • Spring+mybatis+Druid+AbstractRoutingDataSource配置多数据源切换进行读写分离

    自我理解是这样的 首先配置事务管理器设置设置方法是否是只读创建一个DynamicDataSourceTransactionManager的类继承DataSourceTransactionManager去重写doBegin与doCleanup
  • SPSS数据分析中出现的常见问题总结

    总结最近数据分析过程中遇到的一些问题的思考 1 问卷中多选题的录入与分析 2 数据分析流程的第一步 对所分析的样本数据本身的特征结构进行预分析 3 根据数据中的某个因素的几个水平来分析数据总体的差异性 4 根据数据中的变量之间的相关性 了解
  • 如何使用 MSYS2 编译最新版的 coreutils 源码(目前最新版本为 coreutils-9.4)

    文章目录 一 coreutils 源码下载 二 MSYS2 安装编译工具 1 pacman Suy 更新软件仓库 2 pacman S msys gcc 安装gcc 3 pacman S msys make 安装make工具 4 解压缩 c