The following program which conforms to C++ ISO does NOT compile with G++ but compiles with no errors using Borland C++ 5.52 command line compiler. #include <iostream> int main() { std::cout << "Hello World!" << std::endl; } The following errors are produced: julio@linux-wp1w:~> g++ hello_iso.cpp hello_iso.cpp:6:16: warning: missing terminating " character hello_iso.cpp:6: error: missing terminating " character hello_iso.cpp: In function ‘int main()’: hello_iso.cpp:8: error: expected primary-expression before ‘}’ token hello_iso.cpp:8: error: expected `;' before ‘}’ token julio@linux-wp1w:~> g++ hello_iso.cpp > error.log hello_iso.cpp:6:16: warning: missing terminating " character hello_iso.cpp:6: error: missing terminating " character hello_iso.cpp: In function ‘int main()’: hello_iso.cpp:8: error: expected primary-expression before ‘}’ token hello_iso.cpp:8: error: expected `;' before ‘}’ token
It looks like your terminating double quote is not the same as the opening one. How are they encoded on your system?
This program works for me, I copied and pasted your sample and it worked.