【Complier】Makefile error make (e=2): The system cannot find the file specified

###Date: 2018-3-20

____________________________________________________________________________________

     在编译某库过程中,突然出现如下编译错误:

Makefile error make (e=2): The system cannot find the file specified

原因:


经过排查分析,是由于最近安装了git造成的,gmake.exe与git安装路径bin目录下面的bash.exe或sh.exe出现冲突造成编译错误。


解决方案:

去掉%Path%中的gitin路径,编译成功。

案例:

在 stackoverflow下看到了相同问题:


I am using a makefile in windows to push some files on a Unix server (here a text file "blob.txt" in the same folder of my makefile). My makefile script is:

setup:
        pscp blob.txt username@hostname:/folder/

I start a command prompt, go in the folder where blob.txt and the makefile are present and type:

make setup

Which results in:

pscp blob.txt username@hostname:/folder/
process_begin: CreateProcess(NULL, pscp blob.txt username@hostname:/folder/, ...) failed.
make (e=2): The system cannot find the file specified.
make: *** [setup] Error 2

In a #fail ... whereas if I enter directly the command in the command prompt:

pscp blob.txt username@hostname:/folder/

It works ... I really wonder why.

4 Answers


In my case i had gitin in my %PATH% which contains bash.exe and sh.exe.. Removing %GIT_HOME%in from the PATH worked for me


参考:

http://blog.csdn.net/luuillu/article/details/50728354

http://blog.csdn.net/u010746364/article/details/52870947

https://stackoverflow.com/questions/33674973/makefile-error-make-e-2-the-system-cannot-find-the-file-specified

本文为博主原创文章,未经博主允许不得转载。若允许转载,请注明来源https://www.cnblogs.com/SoaringLee/,否则保留追究法律责任的权利!另外,本人提供付费咨询服务并长期承接各类毕设以及外包项目。联系QQ:2963033731。加Q备注:CSDN外包
原文地址:https://www.cnblogs.com/SoaringLee/p/10532532.html