20

I installed MinGW and MSYS on my Windows 7 computer. I added C:\Program Files (x86)\MinGW\bin to my path. Commands such as gcc and g++ work, but make does not. I looked in the directory, and there is no executable called make, even though I installed all components. There is a file called mingw32-make. There are also other files prefixed with mingw32-, such as c++, g++, gcc, gcc-4.6.1, and gfortran. However, there is a make in C:\Program Files (x86)\MinGW\msys\1.0\bin.

If I open the MinGW Shell and type in make, make executes. However, it does not execute from the Windows terminal.

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?

Thomas Owens
  • 114,398
  • 98
  • 311
  • 431
  • Yup, add the msys bin directory to your path (after MinGW's bin dir). That's exactly what the MinGW shell did and why it works there. – eriktous Dec 01 '11 at 00:13
  • @eriktous If you post as an answer, I can accept it. I couldn't find anywhere in the MinGW docs that say to do this - everything just says to add mingw/bin to your path. – Thomas Owens Dec 01 '11 at 00:26
  • @ThomasOwens: I'm pretty sure `mingw32-make` is the same as `make`, it's just prefixed. – user541686 Dec 01 '11 at 00:37
  • Don't know about the docs, but think of it this way: how else is the OS going to find the program? It only looks for executables in directories that are in the PATH. – eriktous Dec 01 '11 at 00:38
  • 1
    @Mehrdad: I'm pretty sure it's not. `mingw32-make` is built to run as a stand-alone program. (MSYS-)`make` needs the MSYS runtime to work. – eriktous Dec 01 '11 at 00:39
  • @eriktous: I'm talking about the functionality, not the particular method of running... do they actually accomplish different goals, or is their environment simply different? – user541686 Dec 01 '11 at 00:41
  • @Mehrdad: IIRC `mingw32-make` is crippled in certain ways. It ususally works for simple things, but if you're doing something more advanced it borks. (I don't recall the specifics, but it may have to do with windows <-> posix path translation, which is handled by the msys.dll.) – eriktous Dec 01 '11 at 00:46
  • @eriktous: Oh I see, thanks for the correction then, I didn't know that. :) – user541686 Dec 01 '11 at 00:47

4 Answers4

10

Yup, add the msys bin directory to your path (after MinGW's bin dir). That's exactly what the MinGW shell does and why it works there.

eriktous
  • 6,569
  • 2
  • 25
  • 35
2

MSYS Answer


  1. Open up your MSYS command terminal (is installed with latest 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. Type Y for yes.
  4. Make is now installed!
  5. Type "make", and it ask you to specify input files.
  6. Probably only call it from the MSYS command terminal.
  7. Pin MSYS command terminal to taskbar by right-clicking its taskbar icon while it's running.
MathCrackExchange
  • 595
  • 1
  • 6
  • 25
1

Try gmake. Sometimes the GNU version of Make installs itself as gmake in order to distinguish from non-GNU Make.

Greg Hewgill
  • 951,095
  • 183
  • 1,149
  • 1,285
  • I forgot to mention, I read the blog post linked to in a question about setting up MinGW. gmake also has no effect. I did read, as I was continuning to wade through Google, that installing to Program Files isn't recommended (although it was the default install directory for me), so I'm reinstalling to C:\mingw as well. – Thomas Owens Nov 30 '11 at 23:23
  • 2
    Yes, mingw will eventually get upset that you've installed it in a path that contains spaces in the name. – Greg Hewgill Nov 30 '11 at 23:24
  • Interesting. I didn't read that until several pages into Google. I just installed to the default location, and figured everything would be good. Apparently, that's not the case. – Thomas Owens Nov 30 '11 at 23:25
  • 1
    The reinstall just finished. There's no `make` or `gmake` in C:\mingw\bin, but there is a `mingw32-make` still. The `make` executable is still located in `C:\mingw\msys\1.0\bin`. I'm thinking about just adding the second directory to my path and being done with it. Hopefully, Eclipse can cope. – Thomas Owens Nov 30 '11 at 23:29
0

C:\Program files\xxx has spaces in it! Since shell scripts are involved, spaces are significant and have to be escaped. Hence this path will not work with mingw. The documentation recommends to install MingW in C:\MingW.