C++ program written in Eclipse using Windows and MinGW cannot display output to console view -


i'm using windows 7 64bit.

i installed eclipse version 3.6.2, cdt, , mingw. have c++ console program in eclipse follows:

#include <iostream> #include <cstdio> using namespace std;  int main() {     setbuf(stdout, null);      (int = 0; < 10000000; i++) {         cout << "!!!hello world!!!" << endl; // prints !!!hello world!!!     }     int val;     cin >> val;      return 0; } 

if run console program, should display hello world console view in eclipse, nothing displays.

if go debug folder , run exe, print console.

if make syntax mistake, eclipse console view show something, such as:

**** internal builder used 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 stopped time consumed: 255 ms.    

why nothing showing in eclipse console view , how can make c++ console program display output?

i found workaround site: http://www.eclipse.org/forums/index.php?=42e862594001fa4469bbc834885d545f&t=msg&th=197552

at link, @ reply "no real name".

in case link goes down, here content:

environment: jdk1.6u18 64bit + eclipse helios 64bit + win7 64bit  no console output @ "run", output correctly @ "debug".  following method worked me:  1.  goto project->properties->run/debug settings, choose .exe file  , press "edit"  2.  in "environment" tag, press "new", set as:      "name:path"     "value:c:\mingw\bin"  in fact, have set "c:\mingw\bin" in windows path environment  variable, seemed not work. 

Comments

Popular posts from this blog

c# - how to write client side events functions for the combobox items -

exception - Python, pyPdf OCR error: pyPdf.utils.PdfReadError: EOF marker not found -