Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse C++ "Nothing to build" error

Tags:

c++

eclipse

build

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.

like image 933
Speedyard Avatar asked Sep 09 '13 13:09

Speedyard


People also ask

Can I compile C on Eclipse?

To use Eclipse for C/C++ programming, you need a C/C++ compiler. On Windows, you could install either MinGW GCC or Cygwin GCC. Choose MinGW if you are not sure, because MinGW is lighter and easier to install, but having less features.


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

like image 111
butron Avatar answered Sep 19 '22 14:09

butron


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)

like image 36
lmoglia Avatar answered Sep 19 '22 14:09

lmoglia


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!

like image 23
Alex Avatar answered Sep 18 '22 14:09

Alex