Skip to main content



      Home
Home » Language IDEs » C / C++ IDE (CDT) » Eclipse CDT on Ubuntu 11.10 x64, debugging problems
Eclipse CDT on Ubuntu 11.10 x64, debugging problems [message #831930] Thu, 29 March 2012 10:33 Go to next message
Eclipse UserFriend
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 10:35] by Moderator

Re: Eclipse CDT on Ubuntu 11.10 x64, debugging problems [message #834717 is a reply to message #831930] Mon, 02 April 2012 05:51 Go to previous messageGo to next message
Eclipse UserFriend
You should flush stdout.
Re: Eclipse CDT on Ubuntu 11.10 x64, debugging problems [message #835915 is a reply to message #834717] Tue, 03 April 2012 17:06 Go to previous messageGo to next message
Eclipse UserFriend
Oh, 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...
Re: Eclipse CDT on Ubuntu 11.10 x64, debugging problems [message #836243 is a reply to message #835915] Wed, 04 April 2012 05:09 Go to previous message
Eclipse UserFriend
Matteo Eit wrote on Tue, 03 April 2012 23:06
Oh, 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.
Previous Topic:Project Compiled but binaries not created
Next Topic:How to get rid of old compilers "include paths not found" warnings?
Goto Forum:
  


Current Time: Wed Jul 23 15:58:06 EDT 2025

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

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

Back to the top