Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » HelloWorld Program not outputting?
HelloWorld Program not outputting? [message #1015516] Fri, 01 March 2013 02:12 Go to next message
Kyle Evans is currently offline Kyle EvansFriend
Messages: 3
Registered: February 2013
Junior Member
// Your Name - Project Title - Date - (Whatever Else-Optional)
#include <iostream>
using namespace std;
int main (void){

cout << "Hello World!";
return 0;
}


I don't know if it is just outputting it very quickly or not at all..l It terminates my program as fast as i can blink. How do i freeze the output? Or does this not happen when it successfully outputs a message?!?
Re: HelloWorld Program not outputting? [message #1015634 is a reply to message #1015516] Fri, 01 March 2013 13:30 Go to previous messageGo to next message
Paul Lawrenson is currently offline Paul LawrensonFriend
Messages: 7
Registered: March 2013
Junior Member
Hi Kyle,
I have the same issue. How did you resolve it please? Thanks. Paul.

Post by Andy Gianfagna solved my issue. Something to do with 64bit PCs.

"I was getting the same behavior on Win 7 64 Bit. Adding the -static-libgcc helped get things to show up in the debugger view, but they still didn't show when running in C++ view. However when I added a PATH variable set to C:\MinGW\bin in the Run Configuration, then I saw stdout when running from a normal run configuration in the C+ view. HTH."

[Updated on: Fri, 01 March 2013 15:50]

Report message to a moderator

Re: HelloWorld Program not outputting? [message #1015683 is a reply to message #1015634] Fri, 01 March 2013 17:11 Go to previous messageGo to next message
Kyle Evans is currently offline Kyle EvansFriend
Messages: 3
Registered: February 2013
Junior Member
I still have not resolved it. I will definitely post back here when I figure this out.

**UPDATE**

I clicked 'Run' a few more times and caught this:

"Info: Nothing to build for HelloWorld"
--------------------------------------------------------

*** Where do I add this PATH?

[Updated on: Fri, 01 March 2013 17:24]

Report message to a moderator

Re: HelloWorld Program not outputting? [message #1015689 is a reply to message #1015683] Fri, 01 March 2013 17:46 Go to previous messageGo to next message
Joost Kraaijeveld is currently offline Joost KraaijeveldFriend
Messages: 273
Registered: July 2009
Senior Member
On 01-03-13 18:11, kyle evans wrote:
> I still have not resolved it. I will definitely post back here when I
> figure this out.
If your platform is Windows and you want to see the output in the
Eclipse console when running the program under control of Eclipse, i.e.
through "Run as->Local C/C++ application", the answer may be here:
http://wiki.eclipse.org/CDT/User/FAQ#Eclipse_console_does_not_show_output_on_Windows


If you run the program by double clicking on any Explorer-like
environment then the behaviour is to be expected. You could either try
to run it from a command prompt or request some final user input before
returning from main.

Joost


Cheers,

Joost
Re: HelloWorld Program not outputting? [message #1017187 is a reply to message #1015689] Sun, 10 March 2013 21:01 Go to previous messageGo to next message
sydney faria is currently offline sydney fariaFriend
Messages: 54
Registered: March 2013
Member
First add in <cstdlib> , using namespace std, and the system("PAUSE"); line at the end the code but before the return(). Now the code will put the output into a window without exiting until you click any key. This idea works fine for the DevC++ compiler for my c code, different library, but same function. Although this is the correct code to put into the Eclipse CDT compiler, there is a problem: it doesn't work! If you run the exe file in a DOS command line window you will get an error message saying that libgcc_s_dw2-1.dll cannot be found! If you look on the internet you will find that this is a common problem with minGW! The dll must is not there! You can download the file and try installing it in the miinGW/bin directory as this seems to be the correct location for the dll file, but I have not done so yet. And minGW has not yet answered my post about fixing this problem with minGW or that the bin directory is the correct directory to put the dll in.
Re: HelloWorld Program not outputting? [message #1017188 is a reply to message #1015516] Sun, 10 March 2013 21:03 Go to previous messageGo to next message
sydney faria is currently offline sydney fariaFriend
Messages: 54
Registered: March 2013
Member
First add in <cstdlib> , using namespace std, and the system("PAUSE"); line at the end the code but before the return(). Now the code will put the output into a window without exiting until you click any key. This idea works fine for the DevC++ compiler for my c code, different library, but same function. Although this is the correct code to put into the Eclipse CDT compiler, there is a problem: it doesn't work! If you run the exe file in a DOS command line window you will get an error message saying that libgcc_s_dw2-1.dll cannot be found! If you look on the internet you will find that this is a common problem with minGW! The dll must is not there! You can download the file and try installing it in the miinGW/bin directory as this seems to be the correct location for the dll file, but I have not done so yet. And minGW has not yet answered my post about fixing this problem with minGW or that the bin directory is the correct directory to put the dll in.
Re: HelloWorld Program not outputting? [message #1019434 is a reply to message #1017188] Fri, 15 March 2013 17:18 Go to previous message
Joost Kraaijeveld is currently offline Joost KraaijeveldFriend
Messages: 273
Registered: July 2009
Senior Member
On 10-03-13 22:03, sydney faria wrote:
> First add in <cstdlib> , using namespace std, and the system("PAUSE");
> line at the end the code but before the return(). Now the code will put
> the output into a window without exiting until you click any key. This
> idea works fine for the DevC++ compiler for my c code, different
> library, but same function. Although this is the correct code to put
> into the Eclipse CDT compiler, there is a problem: it doesn't work! If
> you run the exe file in a DOS command line window you will get an error
> message saying that libgcc_s_dw2-1.dll cannot be found! If you look on
> the internet you will find that this is a common problem with minGW! The
> dll must is not there! You can download the file and try installing it
> in the miinGW/bin directory as this seems to be the correct location for
> the dll file, but I have not done so yet. And minGW has not yet answered
> my post about fixing this problem with minGW or that the bin directory
> is the correct directory to put the dll in.
In a default installation of MinGW it is installed in \mingw\bin. The
poblem is probably that \mingw\bin is not in your path when trying to
start the executable.

Joost


Cheers,

Joost
Previous Topic:Import C++ project from SVN
Next Topic:libxml++ namespace not found
Goto Forum:
  


Current Time: Thu Apr 25 18:03:37 GMT 2024

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

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

Back to the top