我尝试在 Windows 7 下使用简单的 Hello World 程序测试 MinGW,但出现以下错误:
C:\code\helloworld.cpp:2:2: error: invalid preprocessing directive #INCLUDE
C:\code\helloworld.cpp:3:7: error: expected neested-name-specifier before 'namespace'
C:\code\helloworld.cpp:3:17: error: expected ';' before 'std'
C:\code\helloworld.cpp:3:17: error: 'std' does not name a type
C:\code\helloworld.cpp: In function 'int main()':
C:\code\helloworld.cpp:7:2: error: 'cout' was not declared in this scope
我的原始代码如下:
//Hello, World
#INCLUDE <iostream>
using namesapce std;
int main()
{
cout << "Hello, world!";
return 0;
}