I am using a 64-bit Winodws 7. I've downloaded a CDT
Eclipse
and have downloaded MinGW
. After that, I created a c++ hello world project.
This is the code:
#include <iostream>
using namespace std;
int main() {
cout << "!!!Hello World!!!" << endl; // This is supposed to print "Hello World!!!"
return 0;
}
But when I want to run it, this error pops up:
"Launch failed. Binary not found
."
Any help would be highly welcomed.
You have to "Build" your project before you can "Run" it. When using Eclipse for Java, you simply click the "Run" icon, then Eclipse will automaticly compile your program and then run it. With C++ however, this is for whatever reason not the case. Instead of just clicking the "Run" icon, you need to click the "Build" icon first. This is where Eclipse will create a makefile and compile your program. Then you can run it by clicking the "Run" icon.
I hope this solves your problem.
Has eclipse built the EXE file correctly for you? Look for helloworld.exe or whatever, and try running it from a Windows Command prompt.
If not, then you've got a problem with your build. Build it again and check for errors.
If the EXE file is there, but cannot be run from within Eclipse then check that the PE Windows Binary Parser is enabled for your project.
UPDATE: To fix "Unresolved Inclusion" errors, see here. In particular, try this:
- Right-click on the probject and select "Properties"
- Go to "C/C++ General" -> "Paths and Symbols" and select "Includes" tab
- Select "GNU C++"
- Press on "Add..."
- Look for the folder "C:\dev\eclipse\mingw\lib\gcc\mingw32\4.4.1-dw2\include\c++" or similar
UPDATE See also this link:
http://wiki.eclipse.org/CDT/User/FAQ#I_am_using_a_non_gnu_compiler_and_I_get_the_following_messages:_.22Error_launching_external_scanner_info_generator_.28gcc_-E_-P_-v_-dD.22_and_.22File_not_indexed_because_it_was_not_built_.22._How_do_I_get_rid_of_them.3F
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