我正在使用Windows 7 64位.
我安装了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;
}
Run Code Online (Sandbox Code Playgroud)
如果我运行此控制台程序,它应显示Hello world在Eclipse中的Console View,但不显示任何内容.
如果我转到调试文件夹并运行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 …Run Code Online (Sandbox Code Playgroud)