Eclipse CDT using MinGW does not output in console

This worked for me on 64-bit install of Eclipse on Windows 7 using MinGW:

Right-click on your project. Select "Properties".

Select the "Run/Debug Settings" Property on the left of the new window.

In the right window, click on your executable to highlight (ie - Test.exe) and click "Edit".

In the Environment tab, hit "New"

Name: PATH
Value: Path to your MinGW bin directory. (For me this was: C:\devcore\MinGW\bin)

Click "OK" on all windows to close down.

Try running again, it should print output to the screen.


You need to set up linker I am using MinGW.

Follow below steps.

Goto Project > Properties > C/C++ Build > Settings > Tool Settings (Tab) > MinGW C++ Linker (Option) > Add Command (g++ -static-libgcc -static-libstdc++)   (default command is only g++)

purlogic's solution works. Instead to set that for every project, I found it can be set globally:

In Window -> Preferences-> C/C++ -> Build -> Environment Add a variable for your compiler. e.g, I added: MINGW, with value "C:\MinGW\bin"


This console bug has been noticed in 64-bit versions of eclipse:

http://www.eclipse.org/forums/index.php?t=msg&th=197552&start=0&S=2a2b64e1f1404705c0214976bd477428

A workaround is to install the 32-bit eclipse


I ran into the same problem, because of multiple gcc installations on one PC. But Greg's solution only worked partly for me.

In my case the flush was not done in the application explicitly. While C++ programs often use std::cout << ... << std::endl where the endl does a flush, my program used actual C-output such as the usual printf. The printf could be seen directly when starting the program in the cmd-window. However in eclipse console they were missing. Hence a

fflush(stdout);

after the printf did the thing for me. That could be an issue within the eclipse console implementation. I guess that's why fixing the Path did not work for some people here.

An alternative solution instead of setting the PATH within the "Run" settings is to start the whole eclipse using a batch file, which looks essentially like this:

set PATH=<mymingwlocation>\bin;%PATH%
start <myeclipselocation>\eclipse.exe

Then any run configuration would use the correct MingW location by default. That might also fix other problems that could arise from using the wrong gcc.