[c++] Eclipse CDT: no rule to make target all

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

#include <iostream>
using namespace std;

int main() {
  cout << "Hello World!!!" << endl; // prints Hello World!!!
  return 0;
}

Anyone knows how to solve this? I have read the post with the similar title: make: *** No rule to make target `all'. Stop. Eclipse error But none of those answers help...

Thanks a lot!

This question is related to c++ eclipse eclipse-cdt

The answer is


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


Project -> Clean -> Clean all Projects and then Project -> Build Project worked for me (I did the un-checking generate make-file automatically and then rechecking it before doing this). This was for an AVR (micro-processor programming) project through the AVR CDT plugin in eclipse Juno though.


  1. Select Project->Properties from the menu bar.

  2. Click C/C++ Build on the left in the dialog that comes up.

  3. Under the Builder Settings tab on the right, check and make sure the "Build location" is correct.

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

It works for me.


"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.

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.


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:

    (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!

Sometimes if you are making a target via make files double check that all c files are named correctly with correct file structure.


Yet another solution:

I got inside objects.mk file

################################################################################
# Automatically-generated file. Do not edit!
################################################################################

USER_OBJS := /home/../mylib.so

LIBS := -lstdc++fs -lGL -lGLU -lGLEW -lglut -lm -lmylib

then didn't read first line. Then altered next line. It was another projects' folder because I copied this using "copy/clone project" feature and this was causing the error for me. I changed myLib.so into /proper_address/reallyMyLib.so and it worked.

Warning: It may harm some unknown places! Backup whole project before doing this. Because it says "do not edit".


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.


Examples related to c++

Method Call Chaining; returning a pointer vs a reference? How can I tell if an algorithm is efficient? Difference between opening a file in binary vs text How can compare-and-swap be used for a wait-free mutual exclusion for any shared data structure? Install Qt on Ubuntu #include errors detected in vscode Cannot open include file: 'stdio.h' - Visual Studio Community 2017 - C++ Error How to fix the error "Windows SDK version 8.1" was not found? Visual Studio 2017 errors on standard headers How do I check if a Key is pressed on C++

Examples related to eclipse

How do I get the command-line for an Eclipse run configuration? My eclipse won't open, i download the bundle pack it keeps saying error log strange error in my Animation Drawable How to uninstall Eclipse? How to resolve Unable to load authentication plugin 'caching_sha2_password' issue Class has been compiled by a more recent version of the Java Environment Eclipse No tests found using JUnit 5 caused by NoClassDefFoundError for LauncherFactory How to downgrade Java from 9 to 8 on a MACOS. Eclipse is not running with Java 9 "The POM for ... is missing, no dependency information available" even though it exists in Maven Repository The origin server did not find a current representation for the target resource or is not willing to disclose that one exists. on deploying to tomcat

Examples related to eclipse-cdt

Eclipse CDT project built but "Launch Failed. Binary Not Found" Eclipse CDT: no rule to make target all How to see my Eclipse version? Eclipse C++: Symbol 'std' could not be resolved Eclipse CDT: Symbol 'cout' could not be resolved C++ Error 'nullptr was not declared in this scope' in Eclipse IDE "Unresolved inclusion" error with Eclipse CDT for C standard library headers How to enable C++11/C++0x support in Eclipse CDT? How to force Eclipse to ask for default workspace? The program can't start because cygwin1.dll is missing... in Eclipse CDT