Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » CDT » [SOLVED] No Output in Console (Only Displays "<terminated>")
[SOLVED] No Output in Console [message #493340] Sat, 24 October 2009 21:22 Go to previous message
PehJota  is currently offline PehJota
Messages: 3
Registered: October 2009
Junior Member
I'm using Eclipse Galileo on Windows with MinGW. I'm trying to build and run a simple C++ program. It builds fine, and I can run the program from cmd with no problems. But if I try to run the program in Eclipse, I get nothing in the Console view. It says "<terminated>" though. In my web searching I've seen others experiencing this same problem, but unfortunately I haven't seen any solution.

This is the sample program I'm trying to run (just output, nothing complicated):

#include <cstdio>


int main(int argc, char* argv[]) {
	
	printf("Hello.\n");
	fflush(stdout);
	
	return 0;
	
}


Anyone know how to fix this?

EDIT:

Ah, I figured out the problem. Adding the linker flag "-static-libgcc" will fix at least the following three issues that I know of: programs built with MinGW don't work on machines that don't have MinGW installed; programs don't run in the Eclipse Console; and gdb fails when the program starts.

For anyone who may need to know:
To add this flag in Eclipse, go to Project->Properties. Under "C++ Build", select "Settings". Under "MinGW C++ Linker", select "Miscellaneous". Add "-static-libgcc" to the "Linker flags" field. You may have to do this for your other build configurations and projects.

[Updated on: Sun, 25 October 2009 02:06]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message icon14.gif
Read Message
Read Message
Read Message
Previous Topic:CDT changes/shortens breakpoint condition to "...\"
Next Topic:Which Release is best with performance
Goto Forum:
  


Current Time: Sat May 18 19:41:09 EDT 2013

Powered by FUDForum. Page generated in 0.01897 seconds