我正在使用Windows 7 64位.
@H_502_16@我安装了eclipse版本3.6.2,cdt和MinGW.我在Eclipse中有一个C控制台程序,如下所示:
#include <iostream> #include <cstdio> using namespace std; int main() { setbuf(stdout,NULL); for (int i = 0; i < 10000000; i++) { cout << "!!!Hello World!!!" << endl; // prints !!!Hello World!!! } int val; cin >> val; return 0; }
如果我运行这个控制台程序,它应该在Eclipse中显示控制台视图的Hello world,但不显示任何内容.
如果我去调试文件夹并运行exe,它会打印到控制台.
如果我犯了一些语法错误,那么Eclipse Console View会显示一些东西,比如:
**** 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.