【问题标题】:Error using make on Windows with MinGW使用 MinGW 在 Windows 上使用 make 时出错
【发布时间】:2015-11-27 17:42:49
【问题描述】:

我对使用“make”做任何事情都很陌生,但我不得不尝试用它为一些 C 文件构建一些二进制文件(代码不是我的)。它适用于目录中的大多数文件,但是当它到达“usb”目录时会发生这种情况:

make[1]: Entering directory 'C:/bios_memimage/usb'
/bin/rm -fr scraper.bin
process_begin: CreateProcess(NULL, /bin/rm -fr scraper.bin, ...) failed.
make (e=2): The system cannot find the file specified.
Makefile:10: recipe for target 'scraper.bin' failed
make[1]: *** [scraper.bin] Error 2
make[1]: Leaving directory 'C:/bios_memimage/usb'
Makefile.mingw:14: recipe for target 'subdirusb' failed
make: *** [subdirusb] Error 2

我不熟悉“bin/rm -fr”的含义,并且寻找它并没有产生什么结果。我可以说它没有创建流程,但是它到底找不到什么?有没有补救办法?

【问题讨论】:

  • 尝试将/bin所在的目录添加到$PATH变量中。
  • 如果你指的是 MinGW bin,我在安装时已经这样做了。

标签: c cmd mingw


【解决方案1】:

该行尝试在构建期间删除某些文件名。

https://unix.stackexchange.com/questions/153336/what-does-bin-rm-f-file-do-in-unix

删除 makefile 中的这些行,因为它们显然不适用于 Windows。如果必须删除文件才能继续构建,则将这些行替换为 windows 等效项。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2011-01-26
    • 1970-01-01
    • 1970-01-01
    • 2012-06-06
    • 2013-10-03
    • 2020-08-25
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多