Eclipse C++ "Nothing to build" error

I've been having a "nothing to build error" working with C++ in Eclipse. I have been unable to even get a simple "hello world" program, in a project named "hw," to run:

#include <iostream>
using namespace std;

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

What is this "nothing to build" error? What does it mean? Why is it occurring? How do I fix it? I have checked what few leads I could find both here and elsewhere, but have thus far found nothing to help.

Answers


I had the same problem. I finally resolved everything by carefully following the directions for installing MinGW which require that you install the C and C++ compilers and MSYS basic syste, and MinGW developer toolk packages. Also make sure that C:\MinGW\bin;C:\MinGW\msys\1.0\bin are added to your Path system variables. Insuring all of these did the trick for me.


I think the reason is the name of the source file. If you forget to give it a .cpp postfix it will generate this error. Good luck!


You can check if the project properties are ok. If you change the source code location and do not refresh this project property, probably the compiler will not find it. You can check this as follows:

Right click on Project folder -> C/C++ General -> Paths and Symbols -> Source Location (just in case)


I had the same issue, couldn't get anything to build. I had MinGW installed in the default directory and had to modify my path settings as well. Instructions on changing your path variable can be found http://www.computerhope.com/issues/ch000549.htm


I know the answer was directed at a C++ application but the problem also manifests itself if you import a project into a C project that has files that have an upper case trailing C in the filename. For example if any files exist as FileName.C the above error will be printed.

Simply changing all the files so that they have a lower case 'c' will fix the problem. That is FileName.C becomes FileName.c. This has caught me twice now!

I hope this helps.


I had a similar problem and I think that there are a few words that cannot be used in file names.

I installed Eclipse Mars and MinGW on Windows 7, then opened eclipse to run the classic "Hello World" program and it successfully built, and ran.

So, I created new project "OutPutText" and ran the same code as the "Hello World" and I got the “Nothing to build” error.

Then I myself tried some stupid permutation and combinations of project name. I found out that if I add the word "text" to the name of the file the error comes back and if I don't it runs fine!

I tested even more and found that this particular name "OutPuttingText" is causing the problem but not "OutPut Text" or "OutPutting Text" or "OutPut" as file names.


Ensure your virus protection is disabled before installing the compiler minGW. This is what was causing my identical problem. The virus protection can prevent some dll files from being installed and this error won't be flagged up which is what caused my problems. After installing minGW (without virus protection), re-install eclipse (I used mars2) and it worked fine.

Prior to this I had searched every similar thread but nothing worked. Hope this helps someone else.


enter to Project-> Properties -> Project Natures and add C Nature (should be two enters of "C nature")


Need Your Help

Google Maps geocoding : "google is not defined"

php maps prestashop geocoding google-geocoder

I'm getting an issue when I try to load this code, and I can't figure why it doesn't work...

Using Test::MockDBI multiple times with different results

database perl testing

I'm trying to test some code in different situations (for different result sets). I've got the first test running well, but the next one is trying to reuse the first "table".