MINGW64 "make build" error: "bash: make: command not found"
Asked Answered
H

11

74

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?

Heymann answered 21/4, 2016 at 13:13 Comment(1)
you need set your environment PATH to MinGw bin folder first.Province
D
27

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

Denizen answered 21/4, 2016 at 13:30 Comment(5)
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 suggestAborigine
The package is called msys-make not makeIma
I had to use mingw32-make instead of msys-makeRope
*** ERROR *** package make-3.81-3-msys-1.0.13-lic.tar.lzma is already installed so sad. no one had same problem like meDelwyn
@Delwyn 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.Indivertible
A
79
  • 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.
Anthology answered 4/5, 2017 at 9:52 Comment(3)
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".Forelady
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 folderGrannias
The file make-4.2.1-without-guile-w32-bin.zip is not downloading from the given location. What to do?Brunswick
C
56

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.

Cromer answered 10/12, 2019 at 13:38 Comment(3)
the choco itself is not foundDelwyn
chocolately comes with node, you can install it from chocolately.orgKnurl
I recommend avoiding chocolatey completely. If you don't believe me google "how to remove chocolatey".Conchology
D
27

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

Denizen answered 21/4, 2016 at 13:30 Comment(5)
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 suggestAborigine
The package is called msys-make not makeIma
I had to use mingw32-make instead of msys-makeRope
*** ERROR *** package make-3.81-3-msys-1.0.13-lic.tar.lzma is already installed so sad. no one had same problem like meDelwyn
@Delwyn 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.Indivertible
Q
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)

Quechua answered 28/2, 2023 at 10:45 Comment(0)
A
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"

Annotation answered 1/5, 2023 at 9:28 Comment(0)
A
2

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.

Amman answered 19/7, 2023 at 6:51 Comment(1)
this should be the top answerSapless
K
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".
Kwasi answered 31/8, 2022 at 12:33 Comment(0)
P
0

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

cmake --build .

Plastometer answered 9/4, 2019 at 7:57 Comment(0)
K
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

Kaolack answered 20/5, 2021 at 7:32 Comment(0)
D
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

Decelerate answered 20/4, 2023 at 18:11 Comment(0)
K
-6

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

pip install make

OR

conda install make
Kaylee answered 7/4, 2021 at 8:5 Comment(1)
pip install and conda install are exclusively for Python librariesGilliam

© 2022 - 2024 — McMap. All rights reserved.