C
cranium.2003
hi,
Here is my code
#include <iostream.h>
int main()
{
cout <<"HI";
return 0;
}
and using following command to compile a C++ program
g++ ex1.cpp -o ex1
and errors are
In file included from ex1.cpp:1:
/usr/lib/gcc/x86_64-redhat-linux/3.4.4/../../../../include/c++/3.4.4/iostream:44:28:
bits/c++config.h: No such file or directory
In file included from
/usr/lib/gcc/x86_64-redhat-linux/3.4.4/../../../../include/c++/3.4.4/ios:44,
from
/usr/lib/gcc/x86_64-redhat-linux/3.4.4/../../../../include/c++/3.4.4/ostream:45,
from
/usr/lib/gcc/x86_64-redhat-linux/3.4.4/../../../../include/c++/3.4.4/iostream:45,
from ex1.cpp:1:
/usr/lib/gcc/x86_64-redhat-linux/3.4.4/../../../../include/c++/3.4.4/iosfwd:46:29:
bits/c++locale.h: No such file or directory
/usr/lib/gcc/x86_64-redhat-linux/3.4.4/../../../../include/c++/3.4.4/iosfwd:47:25:
bits/c++io.h: No such file or directory
In file included from
/usr/lib/gcc/x86_64-redhat-linux/3.4.4/../../../../include/c++/3.4.4/ios:46,
from
/usr/lib/gcc/x86_64-redhat-linux/3.4.4/../../../../include/c++/3.4.4/ostream:45,
from
/usr/lib/gcc/x86_64-redhat-linux/3.4.4/../../../../include/c++/3.4.4/iostream:45,
from ex1.cpp:1:
/usr/lib/gcc/x86_64-redhat-linux/3.4.4/../../../../include/c++/3.4.4/bits/char_traits.h:
In static member function `static typename
__gnu_cxx::_Char_types<_CharT>::int_type
__gnu_cxx::char_traits<_CharT>::eof()':
/usr/lib/gcc/x86_64-redhat-linux/3.4.4/../../../../include/c++/3.4.4/bits/char_traits.h:139:
error: `EOF' undeclared (first use this function)
/usr/lib/gcc/x86_64-redhat-linux/3.4.4/../../../../include/c++/3.4.4/bits/char_traits.h:139:
error: (Each undeclared identifier is reported only once for each
function it appears in.)
/usr/lib/gcc/x86_64-redhat-linux/3.4.4/../../../../include/c++/3.4.4/bits/char_traits.h:
In static member function `static int std::char_traits<char>::eof()':
/usr/lib/gcc/x86_64-redhat-linux/3.4.4/../../../../include/c++/3.4.4/bits/char_traits.h:291:
error: `EOF' undeclared (first use this function)
In file included from
/usr/lib/gcc/x86_64-redhat-linux/3.4.4/../../../../include/c++/3.4.4/bits/ios_base.h:45,
from
/usr/lib/gcc/x86_64-redhat-linux/3.4.4/../../../../include/c++/3.4.4/ios:49,
from
/usr/lib/gcc/x86_64-redhat-linux/3.4.4/../../../../include/c++/3.4.4/ostream:45,
from
/usr/lib/gcc/x86_64-redhat-linux/3.4.4/../../../../include/c++/3.4.4/iostream:45,
from ex1.cpp:1:
/usr/lib/gcc/x86_64-redhat-linux/3.4.4/../../../../include/c++/3.4.4/bits/atomicity.h:33:30:
bits/atomic_word.h: No such file or directory
In file included from
/usr/lib/gcc/x86_64-redhat-linux/3.4.4/../../../../include/c++/3.4.4/bits/ios_base.h:45,
from
/usr/lib/gcc/x86_64-redhat-linux/3.4.4/../../../../include/c++/3.4.4/ios:49,
from
/usr/lib/gcc/x86_64-redhat-linux/3.4.4/../../../../include/c++/3.4.4/ostream:45,
from
/usr/lib/gcc/x86_64-redhat-linux/3.4.4/../../../../include/c++/3.4.4/iostream:45,
from ex1.cpp:1:
/usr/lib/gcc/x86_64-redhat-linux/3.4.4/../../../../include/c++/3.4.4/bits/atomicity.h:
At global scope:
/usr/lib/gcc/x86_64-redhat-linux/3.4.4/../../../../include/c++/3.4.4/bits/atomicity.h:39:
error: expected constructor, destructor, or type conversion before
"__exchange_and_add"
/usr/lib/gcc/x86_64-redhat-linux/3.4.4/../../../../include/c++/3.4.4/bits/atomicity.h:39:
error: expected `,' or `;' before "__exchange_and_add"
/usr/lib/gcc/x86_64-redhat-linux/3.4.4/../../../../include/c++/3.4.4/bits/atomicity.h:43:
error: expected `,' or `...' before '*' token
In file included from
/usr/lib/gcc/x86_64-redhat-linux/3.4.4/../../../../include/c++/3.4.4/memory:55,
from
/usr/lib/gcc/x86_64-redhat-linux/3.4.4/../../../../include/c++/3.4.4/string:48,
from
/usr/lib/gcc/x86_64-redhat-linux/3.4.4/../../../../include/c++/3.4.4/bits/locale_classes.h:47,
from
/usr/lib/gcc/x86_64-redhat-linux/3.4.4/../../../../include/c++/3.4.4/bits/ios_base.h:47,
from
/usr/lib/gcc/x86_64-redhat-linux/3.4.4/../../../../include/c++/3.4.4/ios:49,
from
/usr/lib/gcc/x86_64-redhat-linux/3.4.4/../../../../include/c++/3.4.4/ostream:45,
from
/usr/lib/gcc/x86_64-redhat-linux/3.4.4/../../../../include/c++/3.4.4/iostream:45,
from ex1.cpp:1:
/usr/lib/gcc/x86_64-redhat-linux/3.4.4/../../../../include/c++/3.4.4/bits/allocator.h:52:31:
bits/c++allocator.h: No such file or directory
In file included from
/usr/lib/gcc/x86_64-redhat-linux/3.4.4/../../../../include/c++/3.4.4/memory:55,
from
/usr/lib/gcc/x86_64-redhat-linux/3.4.4/../../../../include/c++/3.4.4/string:48,
from
/usr/lib/gcc/x86_64-redhat-linux/3.4.4/../../../../include/c++/3.4.4/bits/locale_classes.h:47,
from
/usr/lib/gcc/x86_64-redhat-linux/3.4.4/../../../../include/c++/3.4.4/bits/ios_base.h:47,
from
/usr/lib/gcc/x86_64-redhat-linux/3.4.4/../../../../include/c++/3.4.4/ios:49,
from
/usr/lib/gcc/x86_64-redhat-linux/3.4.4/../../../../include/c++/3.4.4/ostream:45,
from
/usr/lib/gcc/x86_64-redhat-linux/3.4.4/../../../../include/c++/3.4.4/iostream:45,
from ex1.cpp:1:
/usr/lib/gcc/x86_64-redhat-linux/3.4.4/../../../../include/c++/3.4.4/bits/allocator.h:80:
error: expected template-name before '<' token
/usr/lib/gcc/x86_64-redhat-linux/3.4.4/../../../../include/c++/3.4.4/bits/allocator.h:80:
error: expected `{' before '<' token
/usr/lib/gcc/x86_64-redhat-linux/3.4.4/../../../../include/c++/3.4.4/bits/allocator.h:80:
error: expected unqualified-id before '<' token
/usr/lib/gcc/x86_64-redhat-linux/3.4.4/../../../../include/c++/3.4.4/bits/allocator.h:80:
error: expected `;' before '<' token
In file included from
/usr/lib/gcc/x86_64-redhat-linux/3.4.4/../../../../include/c++/3.4.4/string:53,
from
/usr/lib/gcc/x86_64-redhat-linux/3.4.4/../../../../include/c++/3.4.4/bits/locale_classes.h:47,
from
/usr/lib/gcc/x86_64-redhat-linux/3.4.4/../../../../include/c++/3.4.4/bits/ios_base.h:47,
from
/usr/lib/gcc/x86_64-redhat-linux/3.4.4/../../../../include/c++/3.4.4/ios:49,
from
/usr/lib/gcc/x86_64-redhat-linux/3.4.4/../../../../include/c++/3.4.4/ostream:45,
from
/usr/lib/gcc/x86_64-redhat-linux/3.4.4/../../../../include/c++/3.4.4/iostream:45,
from ex1.cpp:1:
/usr/lib/gcc/x86_64-redhat-linux/3.4.4/../../../../include/c++/3.4.4/bits/basic_string.h:148:
error: `_Atomic_word' does not name a type
/usr/lib/gcc/x86_64-redhat-linux/3.4.4/../../../../include/c++/3.4.4/bits/basic_string.h:
In member function `void std::basic_string<_CharT, _Traits,
_Alloc>::_Rep::_M_dispose(const _Alloc&)':
/usr/lib/gcc/x86_64-redhat-linux/3.4.4/../../../../include/c++/3.4.4/bits/basic_string.h:217:
error: `__exchange_and_add' is not a member of `__gnu_cxx'
/usr/lib/gcc/x86_64-redhat-linux/3.4.4/../../../../include/c++/3.4.4/bits/basic_string.h:
In member function `typename _Alloc::size_type
std::basic_string<_CharT, _Traits, _Alloc>::_M_check(typename
_Alloc::size_type, const char*) const':
/usr/lib/gcc/x86_64-redhat-linux/3.4.4/../../../../include/c++/3.4.4/bits/basic_string.h:290:
error: there are no arguments to `__N' that depend on a template
parameter, so a declaration of `__N' must be available
/usr/lib/gcc/x86_64-redhat-linux/3.4.4/../../../../include/c++/3.4.4/bits/basic_string.h:290:
error: (if you use `-fpermissive', G++ will accept your code, but
allowing the use of an undeclared name is deprecated)
/usr/lib/gcc/x86_64-redhat-linux/3.4.4/../../../../include/c++/3.4.4/bits/basic_string.h:
In member function `typename _Alloc::const_reference
std::basic_string<_CharT, _Traits, _Alloc>::at(typename
_Alloc::size_type) const':
/usr/lib/gcc/x86_64-redhat-linux/3.4.4/../../../../include/c++/3.4.4/bits/basic_string.h:662:
error: there are no arguments to `__N' that depend on a template
parameter, so a declaration of `__N' must be available
/usr/lib/gcc/x86_64-redhat-linux/3.4.4/../../../../include/c++/3.4.4/bits/basic_string.h:
In member function `typename _Alloc::reference
std::basic_string<_CharT, _Traits, _Alloc>::at(typename
_Alloc::size_type)':
/usr/lib/gcc/x86_64-redhat-linux/3.4.4/../../../../include/c++/3.4.4/bits/basic_string.h:681:
error: there are no arguments to `__N' that depend on a template
parameter, so a declaration of `__N' must be available
/usr/lib/gcc/x86_64-redhat-linux/3.4.4/../../../../include/c++/3.4.4/bits/basic_string.h:
In member function `std::basic_string<_CharT, _Traits, _Alloc>&
std::basic_string<_CharT, _Traits, _Alloc>::_M_replace_aux(typename
_Alloc::size_type, typename _Alloc::size_type, typename
_Alloc::size_type, _CharT)':
/usr/lib/gcc/x86_64-redhat-linux/3.4.4/../../../../include/c++/3.4.4/bits/basic_string.h:1359:
error: there are no arguments to `__N' that depend on a template
parameter, so a declaration of `__N' must be available
How to solve those errors?
Here is my code
#include <iostream.h>
int main()
{
cout <<"HI";
return 0;
}
and using following command to compile a C++ program
g++ ex1.cpp -o ex1
and errors are
In file included from ex1.cpp:1:
/usr/lib/gcc/x86_64-redhat-linux/3.4.4/../../../../include/c++/3.4.4/iostream:44:28:
bits/c++config.h: No such file or directory
In file included from
/usr/lib/gcc/x86_64-redhat-linux/3.4.4/../../../../include/c++/3.4.4/ios:44,
from
/usr/lib/gcc/x86_64-redhat-linux/3.4.4/../../../../include/c++/3.4.4/ostream:45,
from
/usr/lib/gcc/x86_64-redhat-linux/3.4.4/../../../../include/c++/3.4.4/iostream:45,
from ex1.cpp:1:
/usr/lib/gcc/x86_64-redhat-linux/3.4.4/../../../../include/c++/3.4.4/iosfwd:46:29:
bits/c++locale.h: No such file or directory
/usr/lib/gcc/x86_64-redhat-linux/3.4.4/../../../../include/c++/3.4.4/iosfwd:47:25:
bits/c++io.h: No such file or directory
In file included from
/usr/lib/gcc/x86_64-redhat-linux/3.4.4/../../../../include/c++/3.4.4/ios:46,
from
/usr/lib/gcc/x86_64-redhat-linux/3.4.4/../../../../include/c++/3.4.4/ostream:45,
from
/usr/lib/gcc/x86_64-redhat-linux/3.4.4/../../../../include/c++/3.4.4/iostream:45,
from ex1.cpp:1:
/usr/lib/gcc/x86_64-redhat-linux/3.4.4/../../../../include/c++/3.4.4/bits/char_traits.h:
In static member function `static typename
__gnu_cxx::_Char_types<_CharT>::int_type
__gnu_cxx::char_traits<_CharT>::eof()':
/usr/lib/gcc/x86_64-redhat-linux/3.4.4/../../../../include/c++/3.4.4/bits/char_traits.h:139:
error: `EOF' undeclared (first use this function)
/usr/lib/gcc/x86_64-redhat-linux/3.4.4/../../../../include/c++/3.4.4/bits/char_traits.h:139:
error: (Each undeclared identifier is reported only once for each
function it appears in.)
/usr/lib/gcc/x86_64-redhat-linux/3.4.4/../../../../include/c++/3.4.4/bits/char_traits.h:
In static member function `static int std::char_traits<char>::eof()':
/usr/lib/gcc/x86_64-redhat-linux/3.4.4/../../../../include/c++/3.4.4/bits/char_traits.h:291:
error: `EOF' undeclared (first use this function)
In file included from
/usr/lib/gcc/x86_64-redhat-linux/3.4.4/../../../../include/c++/3.4.4/bits/ios_base.h:45,
from
/usr/lib/gcc/x86_64-redhat-linux/3.4.4/../../../../include/c++/3.4.4/ios:49,
from
/usr/lib/gcc/x86_64-redhat-linux/3.4.4/../../../../include/c++/3.4.4/ostream:45,
from
/usr/lib/gcc/x86_64-redhat-linux/3.4.4/../../../../include/c++/3.4.4/iostream:45,
from ex1.cpp:1:
/usr/lib/gcc/x86_64-redhat-linux/3.4.4/../../../../include/c++/3.4.4/bits/atomicity.h:33:30:
bits/atomic_word.h: No such file or directory
In file included from
/usr/lib/gcc/x86_64-redhat-linux/3.4.4/../../../../include/c++/3.4.4/bits/ios_base.h:45,
from
/usr/lib/gcc/x86_64-redhat-linux/3.4.4/../../../../include/c++/3.4.4/ios:49,
from
/usr/lib/gcc/x86_64-redhat-linux/3.4.4/../../../../include/c++/3.4.4/ostream:45,
from
/usr/lib/gcc/x86_64-redhat-linux/3.4.4/../../../../include/c++/3.4.4/iostream:45,
from ex1.cpp:1:
/usr/lib/gcc/x86_64-redhat-linux/3.4.4/../../../../include/c++/3.4.4/bits/atomicity.h:
At global scope:
/usr/lib/gcc/x86_64-redhat-linux/3.4.4/../../../../include/c++/3.4.4/bits/atomicity.h:39:
error: expected constructor, destructor, or type conversion before
"__exchange_and_add"
/usr/lib/gcc/x86_64-redhat-linux/3.4.4/../../../../include/c++/3.4.4/bits/atomicity.h:39:
error: expected `,' or `;' before "__exchange_and_add"
/usr/lib/gcc/x86_64-redhat-linux/3.4.4/../../../../include/c++/3.4.4/bits/atomicity.h:43:
error: expected `,' or `...' before '*' token
In file included from
/usr/lib/gcc/x86_64-redhat-linux/3.4.4/../../../../include/c++/3.4.4/memory:55,
from
/usr/lib/gcc/x86_64-redhat-linux/3.4.4/../../../../include/c++/3.4.4/string:48,
from
/usr/lib/gcc/x86_64-redhat-linux/3.4.4/../../../../include/c++/3.4.4/bits/locale_classes.h:47,
from
/usr/lib/gcc/x86_64-redhat-linux/3.4.4/../../../../include/c++/3.4.4/bits/ios_base.h:47,
from
/usr/lib/gcc/x86_64-redhat-linux/3.4.4/../../../../include/c++/3.4.4/ios:49,
from
/usr/lib/gcc/x86_64-redhat-linux/3.4.4/../../../../include/c++/3.4.4/ostream:45,
from
/usr/lib/gcc/x86_64-redhat-linux/3.4.4/../../../../include/c++/3.4.4/iostream:45,
from ex1.cpp:1:
/usr/lib/gcc/x86_64-redhat-linux/3.4.4/../../../../include/c++/3.4.4/bits/allocator.h:52:31:
bits/c++allocator.h: No such file or directory
In file included from
/usr/lib/gcc/x86_64-redhat-linux/3.4.4/../../../../include/c++/3.4.4/memory:55,
from
/usr/lib/gcc/x86_64-redhat-linux/3.4.4/../../../../include/c++/3.4.4/string:48,
from
/usr/lib/gcc/x86_64-redhat-linux/3.4.4/../../../../include/c++/3.4.4/bits/locale_classes.h:47,
from
/usr/lib/gcc/x86_64-redhat-linux/3.4.4/../../../../include/c++/3.4.4/bits/ios_base.h:47,
from
/usr/lib/gcc/x86_64-redhat-linux/3.4.4/../../../../include/c++/3.4.4/ios:49,
from
/usr/lib/gcc/x86_64-redhat-linux/3.4.4/../../../../include/c++/3.4.4/ostream:45,
from
/usr/lib/gcc/x86_64-redhat-linux/3.4.4/../../../../include/c++/3.4.4/iostream:45,
from ex1.cpp:1:
/usr/lib/gcc/x86_64-redhat-linux/3.4.4/../../../../include/c++/3.4.4/bits/allocator.h:80:
error: expected template-name before '<' token
/usr/lib/gcc/x86_64-redhat-linux/3.4.4/../../../../include/c++/3.4.4/bits/allocator.h:80:
error: expected `{' before '<' token
/usr/lib/gcc/x86_64-redhat-linux/3.4.4/../../../../include/c++/3.4.4/bits/allocator.h:80:
error: expected unqualified-id before '<' token
/usr/lib/gcc/x86_64-redhat-linux/3.4.4/../../../../include/c++/3.4.4/bits/allocator.h:80:
error: expected `;' before '<' token
In file included from
/usr/lib/gcc/x86_64-redhat-linux/3.4.4/../../../../include/c++/3.4.4/string:53,
from
/usr/lib/gcc/x86_64-redhat-linux/3.4.4/../../../../include/c++/3.4.4/bits/locale_classes.h:47,
from
/usr/lib/gcc/x86_64-redhat-linux/3.4.4/../../../../include/c++/3.4.4/bits/ios_base.h:47,
from
/usr/lib/gcc/x86_64-redhat-linux/3.4.4/../../../../include/c++/3.4.4/ios:49,
from
/usr/lib/gcc/x86_64-redhat-linux/3.4.4/../../../../include/c++/3.4.4/ostream:45,
from
/usr/lib/gcc/x86_64-redhat-linux/3.4.4/../../../../include/c++/3.4.4/iostream:45,
from ex1.cpp:1:
/usr/lib/gcc/x86_64-redhat-linux/3.4.4/../../../../include/c++/3.4.4/bits/basic_string.h:148:
error: `_Atomic_word' does not name a type
/usr/lib/gcc/x86_64-redhat-linux/3.4.4/../../../../include/c++/3.4.4/bits/basic_string.h:
In member function `void std::basic_string<_CharT, _Traits,
_Alloc>::_Rep::_M_dispose(const _Alloc&)':
/usr/lib/gcc/x86_64-redhat-linux/3.4.4/../../../../include/c++/3.4.4/bits/basic_string.h:217:
error: `__exchange_and_add' is not a member of `__gnu_cxx'
/usr/lib/gcc/x86_64-redhat-linux/3.4.4/../../../../include/c++/3.4.4/bits/basic_string.h:
In member function `typename _Alloc::size_type
std::basic_string<_CharT, _Traits, _Alloc>::_M_check(typename
_Alloc::size_type, const char*) const':
/usr/lib/gcc/x86_64-redhat-linux/3.4.4/../../../../include/c++/3.4.4/bits/basic_string.h:290:
error: there are no arguments to `__N' that depend on a template
parameter, so a declaration of `__N' must be available
/usr/lib/gcc/x86_64-redhat-linux/3.4.4/../../../../include/c++/3.4.4/bits/basic_string.h:290:
error: (if you use `-fpermissive', G++ will accept your code, but
allowing the use of an undeclared name is deprecated)
/usr/lib/gcc/x86_64-redhat-linux/3.4.4/../../../../include/c++/3.4.4/bits/basic_string.h:
In member function `typename _Alloc::const_reference
std::basic_string<_CharT, _Traits, _Alloc>::at(typename
_Alloc::size_type) const':
/usr/lib/gcc/x86_64-redhat-linux/3.4.4/../../../../include/c++/3.4.4/bits/basic_string.h:662:
error: there are no arguments to `__N' that depend on a template
parameter, so a declaration of `__N' must be available
/usr/lib/gcc/x86_64-redhat-linux/3.4.4/../../../../include/c++/3.4.4/bits/basic_string.h:
In member function `typename _Alloc::reference
std::basic_string<_CharT, _Traits, _Alloc>::at(typename
_Alloc::size_type)':
/usr/lib/gcc/x86_64-redhat-linux/3.4.4/../../../../include/c++/3.4.4/bits/basic_string.h:681:
error: there are no arguments to `__N' that depend on a template
parameter, so a declaration of `__N' must be available
/usr/lib/gcc/x86_64-redhat-linux/3.4.4/../../../../include/c++/3.4.4/bits/basic_string.h:
In member function `std::basic_string<_CharT, _Traits, _Alloc>&
std::basic_string<_CharT, _Traits, _Alloc>::_M_replace_aux(typename
_Alloc::size_type, typename _Alloc::size_type, typename
_Alloc::size_type, _CharT)':
/usr/lib/gcc/x86_64-redhat-linux/3.4.4/../../../../include/c++/3.4.4/bits/basic_string.h:1359:
error: there are no arguments to `__N' that depend on a template
parameter, so a declaration of `__N' must be available
How to solve those errors?