title: C++ program written in Eclipse using Windows and MinGW cannot display output to console view
body: <p>I'm using Windows 7 64bit.</p>
  
  <p>I installed eclipse version 3.6.2, cdt, and MinGW. I have a C++ console program in Eclipse as follows:</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;cstdio&gt;
  using namespace std;
  
  int main() {
      setbuf(stdout, NULL);
  
      for (int i = 0; i &lt; 10000000; i++) {
          cout &lt;&lt; "!!!Hello World!!!" &lt;&lt; endl; // prints !!!Hello World!!!
      }
      int val;
      cin &gt;&gt; val;
  
      return 0;
  }
  </code></pre>
  
  <p>If I run this console program, it should display <code>Hello world</code> to Console View in Eclipse, but nothing displays.</p>
  
  <p>If I go to the debug folder and run the exe, it does print to the console.</p>
  
  <p>If I make some syntax mistake, then the Eclipse Console View will show something, such as:</p>
  
  <pre><code>**** Internal Builder is used for build ****
  g++ -O0 -g3 -Wall -c -fmessage-length=0 -osrc\hh.o ..\src\hh.cpp
  ..\src\hh.cpp: In function 'int main()':
  ..\src\hh.cpp:17:3: error: expected ';' before 'return'
  Build error occurred, build is stopped
  Time consumed: 255 ms.   
  </code></pre>
  
  <p>Why is nothing showing in the Eclipse console view and how can I make my C++ console program display output?</p>