"make (e=2): 系统找不到指定的文件"的原因

时间:2022-02-08 15:20:42
mingw32-make



clean all



process_begin



: CreateProcess



(

(null), rm

-f Test1.o Test2.o Main.o

test_me.exe, ...) failed.




make



(e=2): The system cannot find the file specified.



 



mingw32-make



: *** [clean] Error 2



rm





-f Test1.o Test2.o Main.o

test_me.exe




This means that mingw32-make was unable to find the utility "rm". Unfortunately, MinGW does not come with "rm". To correct this, replace the clean rule in your Makefile with:

 



clean :







        -del

$(REBUILDABLES)




        echo

Clean done




The leading minus sign tells make to consider the clean rule to be successful even if the del command returns failure. This may be acceptable since the del command will fail if the specified files to be deleted do not exist yet (or anymore).

 

另外也可以根据eclipse的帮助,安装MSYS-1.0.10.exe并设置环境变量,里面包含rm等相关的命令。

    If you want to use Makefile projects, download and run the setup program from the following location: MSYS-1.0.10.exe. MSYS provides an implementation of make and related command line tools. This is not required for other types of projects with the MinGW toolchain, which use CDT's internal build tools to perform the build.


参考:http://www.xilinx.com/support/documentation/sw_manuals/xilinx11/SDK_doc/concepts/cdt_c_makefile.htm