首页 > 解决方案 > 为什么 Mingw64 中的 `make` 会启动一个新的 shell?

问题描述

我正在运行 Mingw64,并且正在编译GLFW。我已经cmake . -G "MinGW Makefiles"成功运行,它是Makefile在我当前的工作目录中生成的。

但是,当我运行make, or时make all,它似乎打开了一个新的外壳??

timle@HUMBOLDT MINGW64 /c/Users/timle/src/glfw-3.3.3
$ make
Microsoft Windows [Version 10.0.19042.867]
(c) 2020 Microsoft Corporation. All rights reserved.

C:\Users\timle\src\glfw-3.3.3>

再次运行make似乎嵌套了问题:

timle@HUMBOLDT MINGW64 /c/Users/timle/src/glfw-3.3.3
$ make
Microsoft Windows [Version 10.0.19042.867]
(c) 2020 Microsoft Corporation. All rights reserved.

C:\Users\timle\src\glfw-3.3.3>make
make
make[1]: Entering directory '/c/Users/timle/src/glfw-3.3.3'
Microsoft Windows [Version 10.0.19042.867]
(c) 2020 Microsoft Corporation. All rights reserved.

C:\Users\timle\src\glfw-3.3.3>

并使用 ctrl+c 退出会给出:

C:\Users\timle\src\glfw-3.3.3>make: *** [Makefile:620: cmake_check_build_system] Interrupt
make[1]: *** [Makefile:620: cmake_check_build_system] Interrupt

到底是怎么回事?我该怎么做make

输出make -v

GNU Make 4.3
Built for x86_64-pc-msys
Copyright (C) 1988-2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://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.

(这让我们在运行它时获得了微软版权变得更加奇怪了??)

(这也是为什么我不认为这是这个问题的重复- 看来我确实安装了正确的版本make

标签: makefilecmakegnu-makemingw-w64

解决方案


原来是你想使用的 MinGW64 mingw32-make,而不仅仅是普通make的,它似乎运行 Microsoft make ‍♂️</p>

如果有人知道为什么make -v建议 GNU make 的输出,但运行它却建议 Microsoft make,请告诉我!


推荐阅读