Search code examples
c++eclipseeclipse-cdt

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!


Solution

  • You need to change your project settings so that Eclipse-CDT manages your Makefiles for you.

    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, select "Generate Makefiles automatically" under the Makefile generation section.
    4. Hit OK and build again.