question about running a simple program [message #151546] |
Fri, 19 August 2005 01:02  |
Eclipse User |
|
|
|
Originally posted by: sanduoren.yahoo.com.cn
A simple Program as follows:
#include <stdio.h>
int main()
{
printf("hello world\n");
return 0;
}
In the first run, "hello world" was displayed normally in the console.
But when I wanted to run it again(the 3rd time, the 4th time...), the
content couldn't be displayed, and "<terminated>hello[C/C++ Local
Application] C:\Document and
Setting\CDTBeginner\workspace\hello\Debug\hello.exe" was shown in the
console.
In a word, the program can't run twice in Eclipse, while I can run the
exe as many times as I can by using the command prompt.
Is it a bug? (Eclipse 3.1 + CDT 3.0 + MinGW4.1.0)
|
|
|
|
Re: question about running a simple program [message #151648 is a reply to message #151546] |
Fri, 19 August 2005 21:40  |
Eclipse User |
|
|
|
"CDTBeginner" <sanduoren@yahoo.com.cn> wrote in message
news:47b8cf427d4e5be9f4ce73e98eb7b3bc$1@www.eclipse.org...
> A simple Program as follows:
> #include <stdio.h>
>
> int main()
> {
> printf("hello world\n");
>
> return 0;
> }
>
> In the first run, "hello world" was displayed normally in the console.
> But when I wanted to run it again(the 3rd time, the 4th time...), the
> content couldn't be displayed, and "<terminated>hello[C/C++ Local
> Application] C:\Document and
> Setting\CDTBeginner\workspace\hello\Debug\hello.exe" was shown in the
> console.
>
> In a word, the program can't run twice in Eclipse, while I can run the
> exe as many times as I can by using the command prompt.
>
> Is it a bug? (Eclipse 3.1 + CDT 3.0 + MinGW4.1.0)
>
It's a bug with the console and a real pain if you want to write console
apps! See https://bugs.eclipse.org/bugs/show_bug.cgi?id=102043. Vote for
this bug, please. Let's get this fixed in 3.0.1.
The program is actually running correctly, but you can't see the output. The
only workaround I've found to work is to run the program in the debugger and
look at the console window outside of Eclipse that gets started with the
debugger. Make sure to put a breakpoint on the last line of the program so
that the window does not close before you can see the output.
|
|
|
Powered by
FUDForum. Page generated in 0.29965 seconds