Eclipse CDT clean fails on Windows: tries to run rm -rf

后端 未结 5 999

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 -rf and the cl

相关标签:
5条回答
  • 2021-01-20 05:47

    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" ...>
    
    0 讨论(0)
  • 2021-01-20 05:48

    The best solution is to install GnuUtils/coreutils and add the installed directory (C:\ProgramFiles\GnuWin32\bin)to your windows path then restart eclipse.

    Eclipse should execute rm-rf now...

    If it still doesn't work, just restart Windows (to set path in windows memeory) and check your path again to be sure it has \GnuWin32\bin . Finally start eclipse.

    0 讨论(0)
  • 2021-01-20 06:02

    I had this error because i had a typo in MSYS_HOME under Project->properties->C/C++ Build->Environment

    0 讨论(0)
  • 2021-01-20 06:05

    A simple solution is to install Git for Windows and enable Unix-like commands for cmd.exe in the installation options. Then rm -rf will be supported.

    0 讨论(0)
  • 2021-01-20 06:06

    I have found a workaround, that works good for me: If you look in the managed make makefile, you can find a line "RM := ..." After that line there is a line "-include ../makefile.defs" which does not exist in my case.

    If you create this file, you can redefine the "RM := ..." macro to whatever you want.

    For example: RM := del

    In this case, the automated build process will use your definition to delete files and folders and not the predefined definition of eclipse.

    0 讨论(0)
提交回复
热议问题