0

Version: Neon.2 Release (4.6.2)

I had the error: Eclipse MinGW Binary Not Found when trying to run the "Hello World" template in eclipse. I never found a solution on Stack Overflow or anywhere else but randomly tried clicking "Project" > "Build All" before running the program and the problem was fixed. Also what is strange is you only have to click "Build All" once. Any time after that even after changing the code you only have to click "Run".

My question is, what makes Eclipse for C++ different than Eclipse for Java where you have to click "Build All" before you run. Why doesn't Eclipse do it automatically? Is this just a bug or is there a fundamental difference in the way C++ works that requires this?

Community
  • 1
  • 1
Andrew
  • 19
  • 2
  • 4
  • Many reasons why Eclipse may not be able to find mingw. Since you had a miraculous fix it sounds like Eclipse needed to get an update to the system path. Might as well lose this part of the question because it just muddies the actual question. – user4581301 Feb 12 '17 at 21:17

1 Answers1

0

Build Automatically is defaulted to off for C++ because building a C++ program can be much more time consuming than you're probably comfortable with and significantly more than patching a file's worth of Java byte code.

I'm not sure you can even turn it on anymore. It looks like it's turned on on my copy of Eclipse (Project->Build Automatically) but it is definitely not being respected by C or C++ projects.

Why is a Java build so much faster than a C or C++ build? Java doesn't do as much at compile time because for Java, a significant portion of compile time is performed at run time (or not at all) and it is quite likely only building the one file that was saved. C++ is building a complete and possibly stand-alone program each and every time. Here is a good question on the topic: Why does C++ compilation take so long?

Community
  • 1
  • 1
user4581301
  • 33,082
  • 7
  • 33
  • 54
  • Any idea after the first build why it automatically builds? – Andrew Feb 12 '17 at 22:00
  • @Andrew None. Digging around, I find Project Properties->C/C++->Build Behaviour Tab->Workbench Build Type->Build on Resource save. I turn that on and I get the Autobuild. Watch out for this, though. Make the right kind of template error and you will get so much error message barf that you'll be sitting around for a loooong time. – user4581301 Feb 12 '17 at 22:18