问题描述
我正在Windows 7上使用Juno与CDT。当我尝试使用内部构建器或MinGW提供的清理项目时,Eclipse运行* X命令
rm -rf
和清洁操作失败。
使用外部构建器(mingw32-make)从控制台进行日志记录:
18:08:07 ****清理构建的配置调试项目threads_example ****
mingw32-make clean
rm -rf ./main .o./main.d threads_example
process_begin:CreateProcess(NULL,rm -rf ./main.o ./main.d threads_example,...)失败。
make(e = 2):系统找不到指定的文件。
mingw32-make:[clean]错误2(忽略)
''
18:08:07构建完成(花了137ms)
使用内部构建器记录:
10:39:35 ****清除构建的配置调试项目threads_example ****
rm -rf threads_example main.o main.d
无法运行程序rm :启动失败
错误:程序rm没有找到PATH
PATH = [C:\CS_powerpc\bin; C:/ Program Files(x86)/ Java / jre7 / bin / client; C:/ Program Files(x86)/ Java / jre7 / bin; C:/ Program Files(x86)/ Java / jre7 / lib / i386; C:\Program Files\Common Files\Microsoft Shared \Microsoft Online Services; C:\Program Files(x86)\Common Files\Microsoft Shared\Microsoft Online Services; C:\Program Files\Common Files\Microsoft Shared\Windows Live; C :\程序文件(x86)\Common Files\Microsoft Shared\Windows Live; C:\Windows\system32; C:\Windows ; C:\Windows\System32\Wbem; C:\Windows\System32\WindowsPowerShell\v1.0\; C:\Program Files\Intel\WiFi\bin\; C:\Program Files\Common Files\Intel\WirelessCommon\; C:\Program Files(x86)\Windows Live\Shared; C:\Program Files(x86)\Common Files\\ \\ Roxio Shared\OEM\DLLShared\; C:\Program Files(x86)\Common Files\Roxio Shared\OEM\DLLShared\; C:\Program Files(x86)\Common Files \Roxio Shared\OEM\12.0\DLLShared\; C:\Program Files(x86)\Roxio\OEM\AudioCore\; C:\siriusSDK\CS_i686\bin; c:\siriusSDK\CS_powerpc\bin; C:\siriusSDK\MinGW\msys\1.0\bin; C:\MinGW\bin ;; C:\work\eclipse]
10:39:35构建完成(花了41ms)
10:39:35 ****清洁的构建配置调试项目threads_example ****
10:39:35构建完成(花了46ms)
在.cproject文件中有一个属性,xml控制了clean命令。
查找配置标签,并将 cleanCommand
属性设置为您想要的。我已将它设置为 rm -rf
,并使用gnuutils来支持Windows上的命令。
您可以将命令更改为任何。
< configuration artifactExtension =soartifactName =MyProject... cleanCommand =rm -rf...>
I am using Juno with CDT on Windows 7.When I try to clean a project using the internal builder or make provided by MinGW, Eclipse runs the *X command rm -rfand the clean operation fails.
Log using external builder (mingw32-make) from the console:
18:08:07 **** Clean-only build of configuration Debug for project threads_example ****
mingw32-make clean
rm -rf ./main.o ./main.d threads_example
process_begin: CreateProcess(NULL, rm -rf ./main.o ./main.d threads_example, ...) failed.
make (e=2): The system cannot find the file specified.
mingw32-make: [clean] Error 2 (ignored)
' '
18:08:07 Build Finished (took 137ms)
Log using the internal builder:
10:39:35 **** Clean-only build of configuration Debug for project threads_example ****
rm -rf threads_example main.o main.d
Cannot run program "rm": Launching failed
Error: Program "rm" not found in PATH
PATH=[C:\CS_powerpc\bin;C:/Program Files (x86)/Java/jre7/bin/client;C:/Program Files (x86)/Java /jre7/bin;C:/Program Files (x86)/Java/jre7/lib/i386;C:\Program Files\Common Files\Microsoft Shared\Microsoft Online Services;C:\Program Files (x86)\Common Files\Microsoft Shared\Microsoft Online Services;C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\Program Files (x86)\Common Files\Microsoft Shared\Windows Live;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Program Files (x86)\Windows Live\Shared;C:\Program Files (x86)\Common Files\Roxio Shared\OEM\DLLShared\;C:\Program Files (x86)\Common Files\Roxio Shared\OEM\DLLShared\;C:\Program Files (x86)\Common Files\Roxio Shared\OEM\12.0\DLLShared\;C:\Program Files (x86)\Roxio\OEM\AudioCore\;C:\siriusSDK\CS_i686\bin;c:\siriusSDK\CS_powerpc\bin;C:\siriusSDK\MinGW\msys\1.0\bin;C:\MinGW\bin;;C:\work\eclipse]
10:39:35 Build Finished (took 41ms)
10:39:35 **** Clean-only build of configuration Debug for project threads_example ****
10:39:35 Build Finished (took 46ms)
Turns out there's an attribute in the .cproject file xml the controls the clean command.
Look for the configuration tag, and set the cleanCommand
attribute to what you want. I've set it to rm -rf
and used gnuutils to support the command on windows.
You can change the command to whatever.
<configuration artifactExtension="so" artifactName="MyProject" ... cleanCommand="rm -rf" ...>
这篇关于Windows CD上的Eclipse CDT清理失败:尝试运行rm -rf的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!