Skip to main content



      Home
Home » Language IDEs » C / C++ IDE (CDT) » Can't even get the pre-made HelloWorld to work
Can't even get the pre-made HelloWorld to work [message #1095418] Mon, 26 August 2013 23:11 Go to next message
Eclipse UserFriend
So, first let me just say I've used Eclipse for Java for several years, but now that I'm trying to get to learn C++, it's all confusion.

I went ahead and installed all the packages I need from MinGW, and went through the Eclipse help topic about setting up, building, and running the example HelloWorld program.

There aren't any errors or anything, but when I run it, the Console goes straight to terminated, I don't see anything print.

I'm just so confused. There's a lot more stuff to do to get a simple program running than I'm used to from Java.
Re: Can't even get the pre-made HelloWorld to work [message #1097304 is a reply to message #1095418] Thu, 29 August 2013 10:11 Go to previous messageGo to next message
Eclipse UserFriend
Dear Johnson Joe

One should normally provide the code for problems as it is now impossible to see where you could've gone wrong, lucky it is a simple task and can be accomplished like so:

//A header that includes I don't know what but it does seem to be required as it is in every newly created document Smile
#include "stdafx.h"

//Provides standard input output methods
#include <iostream>

//Allows the calling of functions within the iostream (As far as I know this is how it works)
using namespace std;

int main()
{
//Outputs Hello world! to the console. the "endl" function moves the cursor to the next line.
cout << "Hello world!" << endl;

//Prevents the console from self-terminating and presents the user with the "Press any key to continue..." scenario.
system("PAUSE");

//Returns a value of 0 which normally means the program executed successfully.
return 0;
}
Re: Can't even get the pre-made HelloWorld to work [message #1098079 is a reply to message #1095418] Fri, 30 August 2013 11:30 Go to previous message
Eclipse UserFriend
Try adding the MinGW bin path to the PATH env variable, typically C:\MinGW\bin. See
http://www.eclipse.org/forums/index.php/t/197552/
Previous Topic:Eclipse RDT server crashes with read timed out
Next Topic:Ant in Eclipse C++ Bundle
Goto Forum:
  


Current Time: Fri May 16 17:20:12 EDT 2025

Powered by FUDForum. Page generated in 0.02755 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top