Eclipse CDT: no rule to make target all

前端 未结 11 1152
野性不改
野性不改 2020-12-08 00:22

My Eclipse CDT keeps complaining \"make: *** no rule to make target all\" when I am trying to compile the piece of code below:

#include 
us         


        
相关标签:
11条回答
  • 2020-12-08 00:58

    In C/C++ Build -> Builder Settings, select Internal builder (instead of External builder).

    It works for me.

    0 讨论(0)
  • 2020-12-08 00:58

    I got this same error after renaming and moving around source files. None of the proposed solutions worked for me and I tracked the error to be the meta-files under Debug directory not being updated. Deleting the entire Debug directory and re-build the project solved the problem for me.

    0 讨论(0)
  • 2020-12-08 00:59

    You have 2 cases

    • If you create Makefile by yourself, go to
    1. Select Project->Properties from the menu bar.
    2. Click C/C++ Build on the left in the dialog that comes up.
    3. Disable generate makefile automatically -> Under the Builder Settings tab on the right, check and make sure the "Build location" is correct (That location is where your Makefile)
    • If you don't have Makefile -> You need Eclipse DS-5 to help you create Makefile
    1. Select Project->Properties from the menu bar.
    2. Click C/C++ Build on the left in the dialog that comes up.
    3. Enable generate makefile automatically

    I advise you create Makefile by your self

    0 讨论(0)
  • 2020-12-08 01:00

    If the above solutions did not work for you so -

    Could be that you did not install C++ compiler packages properly, flow this: (Instructions for Win7, 32bit/64bit)

    1. Make sure you install properly one or more of the supporting C++ compiler packages:

      • Eclipse CDT plugin (Installers page) (Installer guide)
      • MinGW package (Install Page)
      • Cygwin package (Install page)

      (I installed MinGW (HowTo Install Videos can be found on YouTube))

      In case you choose to install MinGW packages:

      • Download MinGW installer from the Install Page above
      • Run MinGW installer and make sure to choose the following packages:

        - mingw-developer-toolkit
        - mingw32-base
        - mingw32-gcc-g++
        - msys-base

      • Add MinGW and MSYS bin paths to your PATH environment variable , if you didn't change the default installation folders you should add:

      C:\MinGW\msys\1.0\bin;C:\MinGW\bin;
      • Logoff and log back in for making sure Environment vars kicked in
    2. Create a new C++ project in eclipse:

      • New -> C++ Projects
      • Choose Project type: Executables -> Hello World C++ project
        (Now on the right, under Toolchains you shall see MinGW GCC)
      • Select MinGW GCC from the Toolchains list
      • Hit Finish
    3. In you Hello World Project you shall see + src folder, and + Includes (If so you are probably good to go).

    4. Build project
    5. Run it!
    0 讨论(0)
  • 2020-12-08 01:04

    I just solved this exact issue for myself; even referenced this question.

    I'm assuming you haven't written the "all" rule that Eclipse is complaining about. If this is the case, take these steps:

    1. Go to Project Properties > C/C++ Build > Behaviour Tab.
    2. Leave Build (Incremental Build) Checked.
    3. Remove "all" from the text box next to Build (Incremental Build).
    4. Compile away!

    This lets Eclipse know you aren't trying to use a make target called "all". For some reason, that is the default.

    0 讨论(0)
  • 2020-12-08 01:06

    "all" is a default setting, even though Behaviour->Build (Incremental build) tab has no variable. I solved as

    1. Go to Project Properties > C/C++ Build > Behaviour Tab.
    2. Leave Build (Incremental Build) Checked.
    3. Enter "test" in the text box next to Build (Incremental Build).
    4. Build Project. You will see error message.
    5. Go back to Build (Incremental Build) and delete "test".
    6. Build Project.
    0 讨论(0)
提交回复
热议问题