Bug 41161 - Hello World in C++ ISO does NOT compile
Summary: Hello World in C++ ISO does NOT compile
Status: RESOLVED WORKSFORME
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 4.3.2
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-08-25 01:16 UTC by Julio Rodriguez
Modified: 2009-09-26 19:45 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Julio Rodriguez 2009-08-25 01:16:33 UTC
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
Comment 1 Wolfgang Bangerth 2009-08-25 04:12:55 UTC
It looks like your terminating double quote is not the same as the
opening one. How are they encoded on your system?
Comment 2 Andrew Pinski 2009-09-26 19:45:22 UTC
This program works for me, I copied and pasted your sample and it worked.