79

I am working on Windows 10. I want to run a "make build" in MINGW64 but following error comes up:

$ make build bash: make: command not found 

I want to build Glide for Golang

I tried following:

$ sudo yum install build-essential bash: sudo: command not found 

As well as:

$ yum install build-essential bash: yum: command not found 

And:

$ apt-cyg build-essential bash: apt-cyg: command not found 

How can I "work-around" this problem?

1
  • you need set your environment PATH to MinGw bin folder first. Commented Apr 6, 2019 at 13:00

11 Answers 11

81
  • Go to ezwinports, https://sourceforge.net/projects/ezwinports/files/

  • Download make-4.2.1-without-guile-w32-bin.zip (get the version without guile)

  • Extract zip
  • Copy the contents to C:\ProgramFiles\Git\mingw64\ merging the folders, but do NOT overwrite/replace any exisiting files.
Sign up to request clarification or add additional context in comments.

4 Comments

Just to elaborate: for file(s) inside of extracted zip under: lib/bin/include, ignore 'share' if you want, copy carefully to corresponding folders under C:\ProgramFiles\Git\mingw64\ . Then restart git-bash, you'll see "make".
For Gitbash 2.37.1, the destination for lib folder is libexec\git-core. In my case, there was no need to copy headers from include folder
The file make-4.2.1-without-guile-w32-bin.zip is not downloading from the given location. What to do?
Thank you, it fixed my problem very easily. I can use make commands now with git's mingw64 installation on windows.
61

You can also use Chocolatey.

Having it installed, just run:

choco install make 

When it finishes, it is installed and available in Git for Bash / MinGW.

2 Comments

the choco itself is not found
I recommend avoiding chocolatey completely. If you don't believe me google "how to remove chocolatey".
29

You have to install mingw-get and after that you can run mingw-get install msys-make to have the command make available.

Here is a link for what you want http://www.mingw.org/wiki/getting_started

5 Comments

I am getting following error when i use above steps: mingw-get install make $ mingw-get install make mingw-get.exe: * ERROR * make: unknown package, can you please suggest
The package is called msys-make not make
I had to use mingw32-make instead of msys-make
*** ERROR *** package make-3.81-3-msys-1.0.13-lic.tar.lzma is already installed so sad. no one had same problem like me
@greendino this was the case for me as well; turned out I had MinGW\bin on my PATH but the make executable was under the msys bin directory and that dir was not on the PATH, so make was installed but the shell couldn't find it. My msys bin dir was MinGW\msys\1.0\bin and after adding it to my PATH the make command succeeded.
4

Check out https://leanprover.github.io/lean4/doc/make/msys2.html. The installing dependencies section suggests MSYS2 installation. The relevant section is quoted below.

The official webpage of MSYS2 provides one-click installers. Once installed, you should run the "MSYS2 MinGW 64-bit shell" from the start menu (the one that runs mingw64.exe). Do not run "MSYS2 MSYS" instead! MSYS2 has a package management system, pacman, which is used in Arch Linux.

Once msys2 is installed, as mentioned above open the MSYS2 MinGW64 shell and install make.

pacman -S make 

Optional - uninstall any other installations of MinGW and assuming default path add C:\msys64\usr\bin to the Path variable.

1 Comment

this should be the top answer
2

Mingw64 has mingw32-make.exe instead of make.exe in its bin folder.

Thus, alternative solution is to use mingw32-make, or alias to it.

(Mingw64 latest version: 12.2.0-rt_v10-rev2, from asset x86_64-12.2.0-release-win32-seh-ucrt-rt_v10-rev2.7z)

Comments

2

There are few options available

  1. Go to the file location C:\msys64\mingw64\bin (choose the correct installation location as per your installation) and run the below command in the CMD

    C:\msys64\mingw64\bin>mklink make mingw32-make.exe 
  2. Above link approach is not working for you then simply duplicate "mingw32-make.exe" and then rename it as "make.exe"

Comments

1

We can't use the 'make' command on windows and we don't get it preinstalled with MINGW. So to use it, you need to download it first. The steps are as follows-

  1. Go to https://sourceforge.net/projects/mingw/postdownload and download it.
  2. After the installation is over, go and check if bin folder is present in the directory of MINGW .
  3. If everything works well till now, change the environment variables- go to settings of your laptop and type Environment variables. Go to it's section and click on 'environment variables' at the end.
  4. On the section where 'path' is written, add a new file - the location of the bin file and save.
  5. Install make by typing the following on mingw command line : mingw-get install mingw32-make
  6. Now make is installed. To use it in command line just write "mingw32-make" in place of "make".

Comments

0

Try using cmake itself. In the build directory, run:

cmake --build .

Comments

0
  • Go to downloads of jmeubank.github.io/tdm/gcc : https://jmeubank.github.io/tdm-gcc/download/
  • Download 64+32-bit MinGW-w64 edition.
  • Run the .exe file.
  • Click on Remove if you have tdm-gcc already.
  • Then Click on Create to install tdm-gcc.
  • Complete the installation.
  • Add path to environment variable if not added automatically.
  • Now run mingw32-make on your terminal / command prompt.

Hope this works

Comments

0

For Eclipse that uses mingw64 to compile C/C++ code. Do this to use the mingw32-make.exe file in the ....mingw64\bin install directory.

  1. Select the project name in Eclipse that contains the Makefile
  2. Then select "Project" ->properties on the menubar. A popout window will be displayed.
  3. Select the "Build C/C++ Build" menu option in the left pane if not already selected for you. Then select in the right panel the "Builder Settings" tab.
  4. Uncheck the box labeled "Use default build command".
  5. The textbox below the unchecked box becomes ungreyed. Then replace the default "make" command with "mingw32-make"
  6. Select "Apply and Close" and the popout window will close.
  7. Then just select "Project"->clean to start over and it should rebuild the code in the project based on the Makefile. Also it doesn't hurt to save your project changes and restart eclipse too, then build the project again.

Last resort, is copy the mingw32-make.exe in the mingw64\bin directory and rename it as make.exe

Comments

-6

You have to install make first. Run any of the below commands and it will work.

pip install make 

OR

conda install make 

1 Comment

pip install and conda install are exclusively for Python libraries