简体   繁体   English

是否不再包含在 MinGW 和/或 MSYS 中?

[英]Is make no longer included with MinGW and/or MSYS?

I installed MinGW and MSYS on my Windows 7 computer.我在 Windows 7 计算机上安装了 MinGW 和 MSYS。 I added C:\Program Files (x86)\MinGW\bin to my path.我将C:\Program Files (x86)\MinGW\bin添加到我的路径中。 Commands such as gcc and g++ work, but make does not. gccg++等命令有效,但make无效。 I looked in the directory, and there is no executable called make , even though I installed all components.我查看了目录,没有名为make的可执行文件,即使我安装了所有组件。 There is a file called mingw32-make .有一个名为mingw32-make的文件。 There are also other files prefixed with mingw32- , such as c++, g++, gcc, gcc-4.6.1, and gfortran.还有其他前缀为mingw32-的文件,如c++、g++、gcc、gcc-4.6.1、gfortran。 However, there is a make in C:\Program Files (x86)\MinGW\msys\1.0\bin .但是,在C:\Program Files (x86)\MinGW\msys\1.0\bin中有一个make

If I open the MinGW Shell and type in make , make executes.如果我打开 MinGW Shell 并输入make , make 执行。 However, it does not execute from the Windows terminal.但是,它不会从 Windows 终端执行。

Is this intentional, or could I be missing other executables as well?这是故意的,还是我也可能缺少其他可执行文件? Should I just add C:\Program Files (x86)\MinGW\msys\1.0\bin to my path?我应该将C:\Program Files (x86)\MinGW\msys\1.0\bin添加到我的路径中吗?

Yup, add the msys bin directory to your path (after MinGW's bin dir). 是的,将msys bin目录添加到您的路径中(在MinGW的bin目录之后)。 That's exactly what the MinGW shell does and why it works there. 这正是MinGW shell的作用以及它在那里工作的原因。

Try gmake . 试试gmake Sometimes the GNU version of Make installs itself as gmake in order to distinguish from non-GNU Make. 有时,GNU版本的Make将自己安装为gmake ,以区别于非GNU Make。

C:\\Program files\\xxx has spaces in it! C:\\ Program files \\ xxx中有空格! Since shell scripts are involved, spaces are significant and have to be escaped. 由于涉及shell脚本,因此空间很重要并且必须进行转义。 Hence this path will not work with mingw. 因此,这条路径不适用于mingw。 The documentation recommends to install MingW in C:\\MingW. 文档建议在C:\\ MingW中安装MingW。

MSYS Answer MSYS 答案


  1. Open up your MSYS command terminal (is installed with latest MSYS).打开你的 MSYS 命令终端(安装了最新的 MSYS)。
  2. Type in "make".输入“制作”。 It will say it doesn't exist.它会说它不存在。
  3. Accordingly with: https://packages.msys2.org/package/make , type in pacman -S make .相应地: https://packages.msys2.org/package/make ,输入pacman -S make Type Y for yes.输入Y表示是。
  4. Make is now installed!制作现在已安装!
  5. Type "make", and it ask you to specify input files.键入“make”,它会要求您指定输入文件。
  6. Probably only call it from the MSYS command terminal.可能只能从 MSYS 命令终端调用它。
  7. Pin MSYS command terminal to taskbar by right-clicking its taskbar icon while it's running.通过在运行时右键单击其任务栏图标,将 MSYS 命令终端固定到任务栏。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM