MINGW64 “make build”错误:”bash: make: 命令未找到”

huangapple go评论116阅读模式
英文:

MINGW64 "make build" error: "bash: make: command not found"

问题

我正在使用Windows 10操作系统。我想在MINGW64中运行"make build"命令,但是出现了以下错误:

$ make build
bash: make: command not found

我想构建Glide for Golang

我尝试了以下方法:

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

以及:

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

还有:

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

如何解决这个问题?

英文:

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: https://github.com/Masterminds/glide "Glide for Golang"

答案1

得分: 73

  • 前往ezwinports网站,https://sourceforge.net/projects/ezwinports/files/
  • 下载make-4.2.1-without-guile-w32-bin.zip(选择没有guile的版本)
  • 解压缩zip文件
  • 将内容复制到C:\ProgramFiles\Git\mingw64\,合并文件夹,但不要覆盖/替换任何现有文件。
英文:
  • 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.

答案2

得分: 53

你也可以使用Chocolatey。

安装好之后,只需运行以下命令:

choco install make

安装完成后,它将在Git for Bash / MinGW中可用。

英文:

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.

答案3

得分: 27

你需要安装mingw-get,然后可以运行mingw-get install msys-make来获取make命令。

这是你所需要的链接:http://www.mingw.org/wiki/getting_started

英文:

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

答案4

得分: 1

我们无法在Windows上使用"make"命令,并且MINGW没有预装它。因此,要使用它,您需要先下载它。步骤如下:

1)访问https://sourceforge.net/projects/mingw/postdownload并下载它。
2)安装完成后,检查MINGW目录中是否存在bin文件夹。
3)如果到目前为止一切正常,请更改环境变量-打开笔记本电脑的设置,输入"环境变量"。转到其部分,并在末尾点击"环境变量"。
4)在写有"path"的部分,添加一个新文件- bin文件的位置,并保存。
5)通过在MINGW命令行中键入以下内容来安装make:
mingw-get install mingw32-make
6)现在已安装make。要在命令行中使用它,只需将"make"替换为"mingw32-make"。

英文:

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".

答案5

得分: 1

Mingw64的bin文件夹中有mingw32-make.exe而不是make.exe

因此,另一种解决方案是使用mingw32-make,或者给它设置别名。

(Mingw64最新版本:12.2.0-rt_v10-rev2,来自资源x86_64-12.2.0-release-win32-seh-ucrt-rt_v10-rev2.7z)

英文:

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)

答案6

得分: 1

有几个可选方案:

  1. 前往文件位置 C:\msys64\mingw64\bin(根据你的安装选择正确的安装位置),在命令提示符中运行以下命令:

    C:\msys64\mingw64\bin>mklink make mingw32-make.exe
    
  2. 如果上述链接方法对你不起作用,可以简单地复制 "mingw32-make.exe" 并将其重命名为 "make.exe"。

英文:

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"

答案7

得分: 0

尝试使用cmake本身。
在构建目录中运行:

cmake --build .

英文:

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

> cmake --build .

答案8

得分: 0

  • 前往 jmeubank.github.io/tdm/gcc 的下载页面:https://jmeubank.github.io/tdm-gcc/download/
  • 下载 64+32位 MinGW-w64 版本。
  • 运行 .exe 文件。
  • 如果已经安装了 tdm-gcc,请点击 Remove
  • 然后点击 Create 安装 tdm-gcc。
  • 完成安装。
  • 如果没有自动添加路径到环境变量,请手动添加。
  • 现在在你的终端/命令提示符上运行 mingw32-make

希望这个方法有效。

英文:
  • 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

答案9

得分: 0

对于使用mingw64编译C/C++代码的Eclipse,按照以下步骤使用mingw32-make.exe文件:

  1. 在Eclipse中选择包含Makefile的项目名称。
  2. 然后选择菜单栏上的“项目”->“属性”。将显示一个弹出窗口。
  3. 如果左侧窗格中尚未选择“构建C/C++构建”菜单选项,请选择该选项。然后在右侧窗格中选择“构建器设置”选项卡。
  4. 取消选中标记为“使用默认构建命令”的复选框。
  5. 复选框下方的文本框将变为可编辑状态。然后将默认的“make”命令替换为“mingw32-make”。
  6. 选择“应用并关闭”,弹出窗口将关闭。
  7. 然后只需选择“项目”->“清理”以重新开始,它将根据Makefile重新构建项目中的代码。此外,保存项目更改并重新启动Eclipse,然后再次构建项目也是可以的。

最后的办法是将mingw64\bin目录中的mingw32-make.exe复制并重命名为make.exe。

英文:

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 conntains 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

答案10

得分: 0

请查看 https://leanprover.github.io/lean4/doc/make/msys2.html
安装依赖部分建议安装 MSYS2。以下是相关部分的引用。

> MSYS2 的官方网页提供了一键安装程序。安装完成后,您应该从开始菜单中运行“MSYS2 MinGW 64-bit shell”(运行 mingw64.exe 的那个)。不要运行“MSYS2 MSYS”!MSYS2 有一个包管理系统 pacman,它在 Arch Linux 中使用。

安装了 msys2 后,如上所述,打开 MSYS2 MinGW64 shell 并安装 make。

pacman -S make

可选 - 卸载其他 MinGW 安装,并假设默认路径将 C:\msys64\usr\bin 添加到 Path 变量中。

英文:

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.

答案11

得分: -5

你首先需要安装make。运行以下任意一条命令即可。

pip install make

或者

conda install make
英文:

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

pip install make

OR

conda install make

huangapple
  • 本文由 发表于 2016年4月21日 21:13:04
  • 转载请务必保留本文链接:https://go.coder-hub.com/36770716.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定