1

I just started this intro to C++ class, and I wanted to use Eclipse since it is already what I use for Java. I installed the C++ development tools, and created a new project for my pseudo-hello world program. This is the code I need to use:

//Compiler Assignment
//Your name

#include <iostream>
using namespace std;

int main()
{
    cout << "Welcome to C++!\n";

    return 0;
}

My teacher just wanted us to copy and paste that into a compiler and run it to display the message. My issue is that it does not recognize anything that is going on in this program (std, cout both cannot be resolved). I have been reading things everywhere, but I don't understand why this isn't working. I literally cannot write anything in C++ in Eclipse at the moment, because everything cannot be resolved. Sorry if this question seems stupid to you, but I have never done anything in C++ ever, and this doesn't seem like something that normally should be happening. Thanks in advance!

EDIT: When I go to run the program it says "Launch failed. Binary not found."

  • nothing compiles, and I have unresolved errors at every line that contains std or cout – Brandon Woodruff Jun 29 '17 at 12:38
  • So you get errors when building? *What* errors? Can you please edit your question to include the full and complete build output (copy-pasted)? – Some programmer dude Jun 29 '17 at 12:39
  • 1
    The code [compiles](https://ideone.com/cyYbRN) so it is an issue with eclipse. It might still be set to Java. – nwp Jun 29 '17 at 12:39
  • also #inclue gives me the error "Unresolved inclusion: – Brandon Woodruff Jun 29 '17 at 12:39
  • @BrandonWoodruff: Well, report the first error first. `` defines `std::cout`. No wonder you get the subsequent errors. – MSalters Jun 29 '17 at 12:42
  • "Binary not found" seems like you haven't installed the compiler or its dependencies correctly. – Some programmer dude Jun 29 '17 at 12:43
  • This could possibly answer your question. https://stackoverflow.com/questions/4971926/launch-failed-binary-not-found-cdt-on-eclipse-helios – sunny11 Jun 29 '17 at 12:45
  • _"I installed the C++ development tools..."_ which tools (note: CDT for Eclipse does __not__ include a compiler)? And then you have to configure Eclipse to tell it which tool-set you installed and where it's located. – Richard Critten Jun 29 '17 at 12:57
  • @RichardCritten I am not entirely sure what I installed. I have only ever used Eclipse for Java and I just recently found out you can use it for other languages. I followed a tutorial for getting C++ development tools onto Eclipse, but they didn't say anywhere to tell Eclipse which tool-set to use. How would I go about doing that? – Brandon Woodruff Jun 29 '17 at 17:08

0 Answers0