Skip to main content



      Home
Home » Language IDEs » C / C++ IDE (CDT) » question about running a simple program
question about running a simple program [message #151546] Fri, 19 August 2005 01:02 Go to next message
Eclipse UserFriend
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 #151576 is a reply to message #151546] Fri, 19 August 2005 10:00 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: steffen.heinzl.informatik.fh-fulda.de

"CDTBeginner" <sanduoren@yahoo.com.cn> schrieb im Newsbeitrag
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)
>

Yes. If you use Eclipse 3.1 RC1 this bug won't occur.

Regards,
Steffen
Re: question about running a simple program [message #151648 is a reply to message #151546] Fri, 19 August 2005 21:40 Go to previous message
Eclipse UserFriend
"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.
Previous Topic:ESQL?
Next Topic:spawn through rexec/sshexec?
Goto Forum:
  


Current Time: Thu Jul 17 19:47:27 EDT 2025

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

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

Back to the top