Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Unable to Debug C code and see output in eclipse console(Unable to Debug C code and see output in eclipse console)
Unable to Debug C code and see output in eclipse console [message #724704] Mon, 12 September 2011 22:15
publicaab is currently offline publicaabFriend
Messages: 1
Registered: September 2011
Junior Member
I am using MyEclipse v9.1.

I used the MyEclipse Pulse tool to download the CDT Eclipse C/C++ Development Tools v7.0.2.201102110609

I have cygwin installed and I am able to build automatically and write code.

I am able to run my program in cygwin from the command line and get output

/* hi.c */
#include <stdio.h>
#include <stdlib.h>

int main(void) {
        /* On windows requires adding the following two lines at the beginning of
	 * main this if output is to be displayed in the eclipse console
	 * either that or every print statement must flush (fflush) right after
	 */
	setvbuf(stdout, NULL, _IONBF, 0);
	setvbuf(stderr, NULL, _IONBF, 0);
	
        /* attempt to get c program to display output in eclipse
	 * Properties > C/C++ Build > Settings > Tool Settings > Cygwin C Linker > Miscellaneous > Linker flags > enter "-static-libgcc" (no quotes)
	 */

	printf("!!!Hello World!!!"); /* prints !!!Hello World!!! */
	return EXIT_SUCCESS;
}


The code cleans and builds without error.

When I attempt to run I get the message that is displayed in the attached image1

When I attempt to debug I get an error displayed in the attached image2

I have also attached the log file from several of my attempts to execute and debug this project.

other posts relating to this topic and advice I have already attempted.

www.myeclipseide.com/PNphpBB2-printview-t-27749-start-0.html
www.myeclipseide.com/PNphpBB2-printview-t-24605-start-0.html
wiki.eclipse.org/CDT/User/FAQ#Eclipse_console_does_not_show_output_on_Windows
www.myeclipseide.com/PNphpBB2-printview-t-24605-start-0.html
(appologies for not linking, it wouldn't let me as this is my first post)

If anyone has any advice or steps to take I will greatly appreciate it.
  • Attachment: image1.png
    (Size: 33.86KB, Downloaded 363 times)
  • Attachment: image2.png
    (Size: 43.85KB, Downloaded 364 times)
  • Attachment: .log
    (Size: 46.22KB, Downloaded 539 times)
Previous Topic:Setting up Windows/Linux hybrid dev environment - Unresolved types in CDT 8.0?
Next Topic:Compilation freeze
Goto Forum:
  


Current Time: Tue Sep 24 10:05:53 GMT 2024

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

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

Back to the top