I am using pgi 2016 version on ubuntu 16.10. I compiled a simple program
by using the following command
pgc++ prog1.cpp
and got the error. Please let me know why it is happening and what is the solution?
#include
using namespace std;
int main()
{
cout << “Hello World!” << endl;
return 0;
}
pgc++ prog1.cpp
“/usr/include/c++/6/exception”, line 64: error: expected a “;”
virtual ~exception() _GLIBCXX_TXN_SAFE_DYN _GLIBCXX_USE_NOEXCEPT;
^
“/usr/include/c++/6/exception”, line 69: error: expected a “;”
what() const _GLIBCXX_TXN_SAFE_DYN _GLIBCXX_USE_NOEXCEPT;
^
“/usr/include/c++/6/exception”, line 81: error: expected a “;”
virtual ~bad_exception() _GLIBCXX_TXN_SAFE_DYN _GLIBCXX_USE_NOEXCEPT;
^
“/usr/include/c++/6/exception”, line 85: error: expected a “;”
what() const _GLIBCXX_TXN_SAFE_DYN _GLIBCXX_USE_NOEXCEPT;
^
“/usr/include/c++/6/bits/basic_string.h”, line 381: error: expected a “;”
_GLIBCXX_NOEXCEPT_IF(is_nothrow_default_constructible<_Alloc>::value)
^
“/usr/include/c++/6/bits/basic_string.h”, line 5289: error: expected a “;”
_GLIBCXX_NOEXCEPT_IF(noexcept(__lhs.swap(__rhs)))
^
“/usr/include/c++/6/bits/basic_string.h”, line 5312: error: “operator>>” is not
a class or function template name in the current scope
operator>>(basic_istream& __is, basic_string& __str);
^
“/usr/include/c++/6/bits/basic_string.tcc”, line 348: error: declaration is
incompatible with “void std::__cxx11::basic_string<_CharT, _Traits,
_Alloc>::resize(std::__cxx11::basic_string<_CharT, _Traits,
_Alloc>::size_type)” (declared at line 827 of
“/usr/include/c++/6/bits/basic_string.h”)
resize(size_type __n, _CharT __c)
^
“/usr/include/c++/6/stdexcept”, line 120: error: expected a “;”
logic_error(const string& __arg) _GLIBCXX_TXN_SAFE;
^
“/usr/include/c++/6/stdexcept”, line 132: error: expected a “;”
virtual ~logic_error() _GLIBCXX_TXN_SAFE_DYN _GLIBCXX_USE_NOEXCEPT;
^
“/usr/include/c++/6/stdexcept”, line 137: error: expected a “;”
what() const _GLIBCXX_TXN_SAFE_DYN _GLIBCXX_USE_NOEXCEPT;
^
“/usr/include/c++/6/stdexcept”, line 150: error: expected a “;”
explicit domain_error(const string& __arg) _GLIBCXX_TXN_SAFE;
^
“/usr/include/c++/6/stdexcept”, line 161: error: expected a “;”
explicit invalid_argument(const string& __arg) _GLIBCXX_TXN_SAFE;
^
“/usr/include/c++/6/stdexcept”, line 173: error: expected a “;”
explicit length_error(const string& __arg) _GLIBCXX_TXN_SAFE;
^
“/usr/include/c++/6/stdexcept”, line 185: error: expected a “;”
explicit out_of_range(const string& __arg) _GLIBCXX_TXN_SAFE;
^
“/usr/include/c++/6/stdexcept”, line 204: error: expected a “;”
runtime_error(const string& __arg) _GLIBCXX_TXN_SAFE;
^
“/usr/include/c++/6/stdexcept”, line 216: error: expected a “;”
virtual ~runtime_error() _GLIBCXX_TXN_SAFE_DYN _GLIBCXX_USE_NOEXCEPT;
^
“/usr/include/c++/6/stdexcept”, line 221: error: expected a “;”
what() const _GLIBCXX_TXN_SAFE_DYN _GLIBCXX_USE_NOEXCEPT;
^
“/usr/include/c++/6/stdexcept”, line 233: error: expected a “;”
explicit range_error(const string& __arg) _GLIBCXX_TXN_SAFE;
^
“/usr/include/c++/6/stdexcept”, line 244: error: expected a “;”
explicit overflow_error(const string& __arg) _GLIBCXX_TXN_SAFE;
^
“/usr/include/c++/6/stdexcept”, line 255: error: expected a “;”
explicit underflow_error(const string& __arg) _GLIBCXX_TXN_SAFE;
^
21 errors detected in the compilation of “prog1.cpp”.