シンプルな Hello World プログラムを使用して Windows 7 で 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;
}