首页 > 解决方案 > 尝试在 github repo windows 10 上运行 make 时出错

问题描述

当我尝试编译这个程序时,我收到以下错误,我无法找到解决方法。我尝试make -DCC=gcc在谷歌搜索问题时从另一篇文章中得到这个,但没有帮助,而是给了我另一个错误信息

PS \massdns> make
mkdir -p bin
cc  -O3 -std=c11 -DHAVE_EPOLL -DHAVE_SYSINFO -Wall -fstack-protector-strong main.c -o bin/massdns
process_begin: CreateProcess(NULL, cc -O3 -std=c11 -DHAVE_EPOLL -DHAVE_SYSINFO -Wall -fstack-protector-strong main.c -o bin/massdns, ...) failed.
make (e=2): The system cannot find the file specified.
make: *** [Makefile:5: all] Error 2

来自 make 的错误消息-DCC=gcc

PS massdns> make -DCC=gcc
C:\ProgramData\chocolatey\lib\make\tools\install\bin\make (pid = 4284)
C:\ProgramData\chocolatey\lib\make\tools\install\bin\make is suspending for 30 seconds...done sleep(30). Continuing.
make: *** C=gcc: No such file or directory.  Stop.

一直在尝试解决这个问题,所以如果有人可以提供帮助,那将非常有用


回购说要安装这个,这样做

Clone the git repository and cd into the project root folder. Then run make to build from source. If you are not on Linux, run make nolinux. On Windows, the Cygwin packages gcc-core, git and make are required.

编辑:我确实尝试了 make nolinux 命令,只是忘记了我做过,因为我一直在尝试这样做一段时间,它是相同的输出,这是输出

PS massdns> make nolinux
mkdir -p bin
cc  -O3 -std=c11 -Wall -fstack-protector-strong main.c -o bin/massdns
process_begin: CreateProcess(NULL, cc -O3 -std=c11 -Wall -fstack-protector-strong main.c -o bin/massdns, ...) failed.
make (e=2): The system cannot find the file specified.
make: *** [Makefile:11: nolinux] Error 2

标签: gccmakefilecygwin

解决方案


问题解决了,当然是用户错误。

不熟悉如何通过 Cygwin 安装程序安装包、gcc-core、git,因为这是我在安装程序上没有见过的非常独特的交互。我还必须git clone repo_url在 Cygwin 终端内进行操作,并且还必须在 Cygwin 终端内运行make目录。


推荐阅读