如何在 Windows 的 git bash 中运行“make”命令?

Posted

技术标签:

【中文标题】如何在 Windows 的 git bash 中运行“make”命令?【英文标题】:How to run "make" command in gitbash in windows? 【发布时间】:2021-06-06 01:13:09 【问题描述】:

任何人都可以帮助我使用“make”命令在 Windows 中运行 Makefile。当我尝试从 git bash 运行时,出现以下错误,

$ 构建 bash:make:找不到命令

$ 进行部署 bash:make:找不到命令

无论如何要在 gitbash 或其他东西中安装它,还是我需要使用任何其他 Windows 工具?

【问题讨论】:

您是否尝试明确指定 make 的路径? 【参考方案1】:

你也可以用chocolatey来安装:

choco install make

这是package。

【讨论】:

【参考方案2】:

听起来 Make 不在你的 git-bash 路径中。

快速搜索显示this guide,它建议以下步骤:

转到 ezwinports。 下载 make-4.1-2-without-guile-w32-bin.zip(获取不带 guile 的版本)。 解压缩。 将内容复制到您的 Git\mingw64\ 合并文件夹,但不要覆盖/替换任何现有文件。

该指南已有数年历史。在采取行动之前,您可能应该阅读一些 cmets。

【讨论】:

以上是关于如何在 Windows 的 git bash 中运行“make”命令?的主要内容,如果未能解决你的问题,请参考以下文章

如何在 Windows 的 git bash 中运行“make”命令?

如何在 Windows 上的 Git Bash 中退出“git diff”的结果? [复制]

如何在没有 Git Bash 或 GUI 的情况下在 Windows 10 上安装 git?

如何在 Windows 上将 man 和 zip 添加到“git bash”安装中

如何使用适用于 Windows 的 Git 更改 Git Bash 中的目录?

如何在我的 Windows git-bash 终端上获得彩色输出?