【问题标题】:Adding git to the path on Windows breaks Make?将 git 添加到 Windows 上的路径会中断 Make?
【发布时间】:2019-01-26 04:45:22
【问题描述】:

我安装了适用于 Windows 的 Git(便携式版本)并将 "C:/Program Files/Git/bin" 添加到我的系统路径变量中。当我这样做时,它弄乱了我从 Mingw-w64 安装的制作。

当我运行命令来构建我的项目 (make all) 时,我收到此错误:

process_begin: CreateProcess(NULL, echo compiling src/prototype-main.cpp, ...) failed.
make (e=2): The system cannot find the file specified.
make: *** [make/targets.make:40: src/prototype-main.o] Error 2

当我从我的路径变量中删除它时,它又可以正常工作了。那是怎么回事? "Git/bin" 目录中的唯一文件是:

bash.exe
git.exe
sh.exe

【问题讨论】:

    标签: git path gnu-make


    【解决方案1】:

    我发现您需要将"cmd" 目录放入路径,而不是"bin" 目录。这对我来说仍然很奇怪,我仍然不知道如果你把 "bin" 目录放在路径上,它为什么会搞砸 make

    在 Windows 版 Git 的可移植版本中,有一个名为 "README.portable" 的文件。它告诉您(或者使用 git-bash 或 git-cmd 终端)将"cmd" 目录放在路径上并直接使用git

    如果有人知道如果"bin" 目录在路径上,为什么make 会中断,我仍然想知道发生了什么。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-07-27
      • 2020-04-21
      • 2020-07-01
      • 2021-03-06
      相关资源
      最近更新 更多