Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Getting standard error into Eclipse console?
Getting standard error into Eclipse console? [message #235344] Wed, 01 July 2009 08:31 Go to next message
Seth is currently offline SethFriend
Messages: 1
Registered: July 2009
Junior Member
Hello,

I'm just starting up C again for school and giving Eclipse a whirl this
time. Got Eclipse installed under Ubuntu 9.04 and the ANSI C "hello
world" program working great, but if I try any code that throws errors
(seg fault, floating point errors, etc), the errors don't show up in the
Eclipse console, but the other output does. So I'm curious about 2 things:

1) How to get Eclipse to show standard error (I assume this is the prob?)
...or....
2) How to launch the external command line version of my C++ program when
I click the "play" button in Eclipse. (I don't wanna have to alt-tab and
navigate through bash manually, I'm lazy)

Thanks!!
Seth
Re: Getting standard error into Eclipse console? [message #755830 is a reply to message #235344] Wed, 09 November 2011 17:48 Go to previous messageGo to next message
Germano Massullo is currently offline Germano MassulloFriend
Messages: 13
Registered: September 2011
Junior Member
I really need this thing to be clarified or probably I will not longer be able to use Eclipse for C developing...

For example, this code makes segmentation fault error. If you run it from Eclipse (use C99 flag), you will not have segmentation fault errors. If you try from the Linux console, you will have the segmentation fault error message.
How is it possible?
int main()
{
	int *array;
	array = calloc(10,sizeof(int));
	for(int i = 1; i < 10; i++)
	{
		array[i] = i;
	}
	sprintf("%d\n", array[1]);

	return 0;
}
Re: Getting standard error into Eclipse console? [message #755862 is a reply to message #755830] Wed, 09 November 2011 20:57 Go to previous messageGo to next message
Jeff Johnston is currently offline Jeff JohnstonFriend
Messages: 215
Registered: July 2009
Senior Member
The program fails under Eclipse as well, but the exception is not displayed. If you switch to the Debugging perspective, you will see that the program terminated with an exit code of -1. The -1 exit code isn't shown in the console termination message which would have helped you realize this occurred. If you simply debug the program under the debugger you will see the exception displayed by gdb. I have opened: https://bugs.eclipse.org/bugs/show_bug.cgi?id=363383 if you wish to track.
Re: Getting standard error into Eclipse console? [message #755864 is a reply to message #755862] Wed, 09 November 2011 21:31 Go to previous message
Germano Massullo is currently offline Germano MassulloFriend
Messages: 13
Registered: September 2011
Junior Member
I added myself to the list Smile
Previous Topic:Newbie: Eclipse/Qt/MinGW gdb failure
Next Topic:How to Make a C++ Project with Existing Source over NFS mounted source-files
Goto Forum:
  


Current Time: Fri Mar 29 04:48:26 GMT 2024

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

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

Back to the top