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
You have 2 cases
- Select Project->Properties from the menu bar.
- Click C/C++ Build on the left in the dialog that comes up.
- 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)
- Select Project->Properties from the menu bar.
- Click C/C++ Build on the left in the dialog that comes up.
- 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.
Select Project->Properties from the menu bar.
Click C/C++ Build on the left in the dialog that comes up.
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
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)
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:
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;
Create a new C++ project in eclipse:
In you Hello World Project you shall see + src folder, and + Includes (If so you are probably good to go).
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:
This lets Eclipse know you aren't trying to use a make target called "all". For some reason, that is the default.
Source: Stackoverflow.com