Eclipse CDT on Ubuntu 11.10 x64, debugging problems [message #831930] |
Thu, 29 March 2012 14:33 |
Matteo Eit Messages: 7 Registered: March 2012 |
Junior Member |
|
|
Hi all,
Recently I had to install eclipse cdt indigo on my ubuntu 11.10 64bit pc and everything works except for the console output, even simple code like this will generate an output only when the program is terminated
#include <stdio.h>
#include <stdlib.h>
int i=0;
int main(void) {
printf("input:");
scanf("%d", &i);
printf("\nhey dude, %d\n", i);
puts("!!!Hello World!!!"); /* prints !!!Hello World!!! */
return EXIT_SUCCESS;
}
5 // this was my input in console
input:
hey dude, 5
!!!Hello World!!!
I had to input the 5 myself because the execution was stuck waiting for the input even if the first printf was before in the code
Anybody can help me solving this ?
EDIT: even adding fflush(stdin) is not working
[Updated on: Thu, 29 March 2012 14:35] Report message to a moderator
|
|
|
|
|
Re: Eclipse CDT on Ubuntu 11.10 x64, debugging problems [message #836243 is a reply to message #835915] |
Wed, 04 April 2012 09:09 |
Axel Mueller Messages: 1973 Registered: July 2009 |
Senior Member |
|
|
Matteo Eit wrote on Tue, 03 April 2012 23:06Oh, my bad...Is it normal that I've to add after every printf a fflush(stdout)? I had experiences running gdb in terminal and I didn't need that, and I'm pretty sure that when I've used eclipse in past it wasn't needed...
Eclipse uses its own terminal. So you might get a different behavior. However, as you said I never encountered problems with the console in Eclipse under Linux (Windows is something different). But I guess your problems relates to using stdout and stdin.
Before you ask
- search this forum
- see the FAQ http://wiki.eclipse.org/CDT/User/FAQ
- google
|
|
|
Powered by
FUDForum. Page generated in 0.02024 seconds