G ++编译,但没有任何反应

Bea*_*Tie 1 c++ compiler-construction g++

我目前正在运行g++版本4.3.4,当我运行以下命令时:

g ++ -g -Wall test.cpp -o test.exe

对此:

#include<stdlib.h>
#include<iostream>

using namespace std;

int main (){
   cout << "Hello World!";
   system("pause");
   return 0;
}
Run Code Online (Sandbox Code Playgroud)

似乎没有发生任何事情:Cygwin似乎滞后片刻,但没有exe创建(如果cpp源中有错误,则显示它们)

和想法?

Nic*_*tti 5

我怀疑你实际上正在调用内置test命令.你正在执行你的程序./test./test.exe?这应该有效,但我会重命名,以防万一.