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.
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.
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.
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 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!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With