Skip to main content



      Home
Home » Language IDEs » C / C++ IDE (CDT) » HelloWord console app does not appear? Works in debug mode!
HelloWord console app does not appear? Works in debug mode! [message #153590] Fri, 09 September 2005 15:25 Go to next message
Eclipse UserFriend
Environment:
=========
1) Windows 2000 Pro
2) Cygwin fully installed
3) CDT installed in Eclipse 3.1

It appears that in creating a simple 'Hello World' console application
does not appear to open the windows command window when executed
but appears to work only in debug mode.

This was discovered simply because I saw no console window, because
automatic
build failed (due to still running program) and so I terminated the running
program
within the IDE.

I am assuming that I will need to somehow build this simple program such
that
it somehow knows that the the program is a console window? How do I do
this?

Dan
Re: HelloWord console app does not appear? Works in debug mode! [message #153604 is a reply to message #153590] Fri, 09 September 2005 20:30 Go to previous messageGo to next message
Eclipse UserFriend
In the simple HelloWorld.c program, I had a getchar() function after the
printf
statement and noticed that flush did not occur. How do I know that? I
entered
a character within the Console window and then saw the "Hello World" output.

Seems that the output is somehow buffered in the Console window of the IDE

Here is the code:
=======================================
/*
* HelloWorld.c
*/
#include <stdio.h>
int main()
{
(void) printf("Hello World\n");
(void) printf("Hit any key to terminate this program.\n");
(void) getchar();
return (0);
}
=======================================

Also, I tried the cpp version of the code and sheesh, why is it
that the iostream header file is not even located!?!?!? Try this
code as well....

========================================
/*
* HelloWorld.cpp
*/
#include <iostream> // <== Error found here
using namespace std;
int main()
{
cout << "Hello, World!" << endl;
}
========================================
Error reported:
==========
Severity Description Resource In Folder Location Creation Time
1 C/C++ Indexer Problem: Preprocessor Inclusion not found: iostream in file:
E:\Projects\Eclipse\WorkspaceJB\HelloWorld\HelloWorld.cpp on line: 5.
HelloWorld.cpp HelloWorld line 5 September 9, 2005 5:13:29 PM
Re: HelloWord console app does not appear? Works in debug mode! [message #153650 is a reply to message #153604] Sun, 11 September 2005 12:48 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: dschaefer.qnx.com

Dan Thurman wrote:
> In the simple HelloWorld.c program, I had a getchar() function after the
> printf
> statement and noticed that flush did not occur. How do I know that? I
> entered
> a character within the Console window and then saw the "Hello World" output.
>
> Seems that the output is somehow buffered in the Console window of the IDE
>


This is a known problem:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=102043

Doug.

> Here is the code:
> =======================================
> /*
> * HelloWorld.c
> */
> #include <stdio.h>
> int main()
> {
> (void) printf("Hello World\n");
> (void) printf("Hit any key to terminate this program.\n");
> (void) getchar();
> return (0);
> }
> =======================================
>
> Also, I tried the cpp version of the code and sheesh, why is it
> that the iostream header file is not even located!?!?!? Try this
> code as well....
>
> ========================================
> /*
> * HelloWorld.cpp
> */
> #include <iostream> // <== Error found here
> using namespace std;
> int main()
> {
> cout << "Hello, World!" << endl;
> }
> ========================================
> Error reported:
> ==========
> Severity Description Resource In Folder Location Creation Time
> 1 C/C++ Indexer Problem: Preprocessor Inclusion not found: iostream in file:
> E:\Projects\Eclipse\WorkspaceJB\HelloWorld\HelloWorld.cpp on line: 5.
> HelloWorld.cpp HelloWorld line 5 September 9, 2005 5:13:29 PM
>
>
Re: HelloWord console app does not appear? Works in debug mode! [message #155060 is a reply to message #153650] Mon, 26 September 2005 13:31 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: rowck001.bigpond.net.au

I also found this console problem (in Windows) and my solution could help
newbies;

I add a program input wait function, eg. getchar() at the end of the main
function in an application and then execute by double-clicking the exe
from either the debug or release options in the outline and use the dos
box window to view the output

hope this helps
Re: HelloWord console app does not appear? Works in debug mode! [message #155121 is a reply to message #155060] Tue, 27 September 2005 12:22 Go to previous message
Eclipse UserFriend
The point of the problem is that the CDT IDE is not working correctly and
needs to be fixed. There is a bug report filed for this problem.

"Craig Rowlands" <rowck001@bigpond.net.au> wrote in message
news:bad086395e1d5ec2a8e1d5f0e683cc0c$1@www.eclipse.org...
> I also found this console problem (in Windows) and my solution could help
> newbies;
>
> I add a program input wait function, eg. getchar() at the end of the main
> function in an application and then execute by double-clicking the exe
> from either the debug or release options in the outline and use the dos
> box window to view the output
>
> hope this helps
>
Previous Topic:managed make building only 1 file instead of all of them
Next Topic:Debugging - no variables
Goto Forum:
  


Current Time: Wed May 07 07:10:01 EDT 2025

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

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

Back to the top