clang++

Hi all
Downloaded the code llvm and clang and compiled.
But while trying to compile a hello world cpp code, got following error

This seems to be due to location of header files for libstdc++.

[deleisha@delmeetei bin]$ gcc -v -x c++ /dev/null -fsyntax-only
Using built-in specs.
Target: i386-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-libgcj-multifile --enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk --disable-dssi --disable-plugin --with-java-home=/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre --with-cpu=generic --host=i386-redhat-linux
Thread model: posix
gcc version 4.1.2 20080704 (Red Hat 4.1.2-50)
/usr/libexec/gcc/i386-redhat-linux/4.1.2/cc1plus -quiet -v -D_GNU_SOURCE /dev/null -quiet -dumpbase null -mtune=generic -auxbase null -version -fsyntax-only -o /dev/null
ignoring nonexistent directory "/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../i386-redhat-linux/include"
#include "..." search starts here:
#include <...> search starts here:
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/i386-redhat-linux
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/backward
/usr/local/include
/usr/lib/gcc/i386-redhat-linux/4.1.2/include
/usr/include
End of search list.

[deleisha@delmeetei bin]$ clang++ heloo.cpp
In file included from heloo.cpp:1:
In file included from /usr/include/c++/4.4.4/iostream:39:
In file included from /usr/include/c++/4.4.4/ostream:39:
In file included from /usr/include/c++/4.4.4/ios:38:
In file included from /usr/include/c++/4.4.4/iosfwd:40:
/usr/include/c++/4.4.4/bits/stringfwd.h:41:1: error: C++ requires a type specifier for all declarations
_GLIBCXX_BEGIN_NAMESPACE(std)
^
/usr/include/c++/4.4.4/bits/stringfwd.h:41:26: error: use of undeclared identifier ‘std’
_GLIBCXX_BEGIN_NAMESPACE(std)
^
/usr/include/c++/4.4.4/bits/stringfwd.h:41:30: error: expected ‘;’ after top level declarator
_GLIBCXX_BEGIN_NAMESPACE(std)
^
;
/usr/include/c++/4.4.4/bits/stringfwd.h:50:30: error: unknown type name ‘allocator’
typename _Alloc = allocator<_CharT> >
^
/usr/include/c++/4.4.4/bits/stringfwd.h:50:46: error: expected unqualified-id
typename _Alloc = allocator<_CharT> >
^
/usr/include/c++/4.4.4/bits/stringfwd.h:55:11: error: unknown type name ‘basic_string’
typedef basic_string string;
^
/usr/include/c++/4.4.4/bits/stringfwd.h:55:23: error: expected unqualified-id
typedef basic_string string;
^
/usr/include/c++/4.4.4/bits/stringfwd.h:60:11: error: unknown type name ‘basic_string’
typedef basic_string<wchar_t> wstring;
^
/usr/include/c++/4.4.4/bits/stringfwd.h:60:23: error: expected unqualified-id
typedef basic_string<wchar_t> wstring;
^
/usr/include/c++/4.4.4/bits/stringfwd.h:74:1: error: unknown type name ‘_GLIBCXX_END_NAMESPACE’
_GLIBCXX_END_NAMESPACE
^
In file included from heloo.cpp:1:
In file included from /usr/include/c++/4.4.4/iostream:39:
In file included from /usr/include/c++/4.4.4/ostream:39:
In file included from /usr/include/c++/4.4.4/ios:38:
In file included from /usr/include/c++/4.4.4/iosfwd:41:
In file included from /usr/include/c++/4.4.4/bits/postypes.h:41:
In file included from /usr/include/c++/4.4.4/cwchar:43:
In file included from /usr/include/c++/4.4.4/cstddef:43:
/usr/local/lib/clang/2.8/include/stddef.h:29:1: error: expected unqualified-id
typedef typeof(((int*)0)-((int*)0)) ptrdiff_t;
^
In file included from heloo.cpp:1:
In file included from /usr/include/c++/4.4.4/iostream:39:
In file included from /usr/include/c++/4.4.4/ostream:39:
In file included from /usr/include/c++/4.4.4/ios:38:
In file included from /usr/include/c++/4.4.4/iosfwd:41:
In file included from /usr/include/c++/4.4.4/bits/postypes.h:41:
In file included from /usr/include/c++/4.4.4/cwchar:43:
/usr/include/c++/4.4.4/cstddef:48:1: error: C++ requires a type specifier for all declarations
_GLIBCXX_BEGIN_NAMESPACE(std)
^
/usr/include/c++/4.4.4/cstddef:48:26: error: use of undeclared identifier ‘std’
_GLIBCXX_BEGIN_NAMESPACE(std)
^
/usr/include/c++/4.4.4/cstddef:48:30: error: expected ‘;’ after top level declarator
_GLIBCXX_BEGIN_NAMESPACE(std)
^
;
/usr/include/c++/4.4.4/cstddef:53:1: error: unknown type name ‘_GLIBCXX_END_NAMESPACE’
_GLIBCXX_END_NAMESPACE
^
In file included from heloo.cpp:1:
In file included from /usr/include/c++/4.4.4/iostream:39:
In file included from /usr/include/c++/4.4.4/ostream:39:
In file included from /usr/include/c++/4.4.4/ios:38:
In file included from /usr/include/c++/4.4.4/iosfwd:41:
In file included from /usr/include/c++/4.4.4/bits/postypes.h:41:
In file included from /usr/include/c++/4.4.4/cwchar:46:
In file included from /usr/include/wchar.h:37:
/usr/include/stdio.h:46:1: error: expected unqualified-id
typedef struct _IO_FILE FILE;
^
In file included from heloo.cpp:1:
In file included from /usr/include/c++/4.4.4/iostream:39:
In file included from /usr/include/c++/4.4.4/ostream:39:
In file included from /usr/include/c++/4.4.4/ios:38:
In file included from /usr/include/c++/4.4.4/iosfwd:41:
In file included from /usr/include/c++/4.4.4/bits/postypes.h:41:
/usr/include/c++/4.4.4/cwchar:64:1: error: C++ requires a type specifier for all declarations
_GLIBCXX_BEGIN_NAMESPACE(std)
^
/usr/include/c++/4.4.4/cwchar:64:26: error: use of undeclared identifier ‘std’
_GLIBCXX_BEGIN_NAMESPACE(std)
^
/usr/include/c++/4.4.4/cwchar:64:30: error: expected ‘;’ after top level declarator
_GLIBCXX_BEGIN_NAMESPACE(std)
^
;
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
[deleisha@delmeetei bin]$

Hello, Devchandra.

Please show us;

$ rpm -qa | fgrep c++

I guess you are using RHEL5 (or clone).

"gcc" (and g++) is 4.1.2.
btw, who provides /usr/include/c++/4.4.4 ?

FYI, with a few tweaks, gcc44's headers and libraries are available on CentOS5.
(on centos5, gcc44-c++-4.4.0-6.el5 is provided)
libstdc++-4.1 would be unavailable with clang++.

$ gcc44 --version
gcc44 (GCC) 4.4.0 20090514 (Red Hat 4.4.0-6)
Copyright (C) 2009 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$ ls -F /usr/include/c++
4.1.1/ 4.1.2@ 4.4.0/

...Takumi

rpm -qa | fgrep c++ gives
gcc-c+±4.1.2-50.el5
libstdc++44-devel-4.4.4-13.el5
gcc44-c+±4.4.4-13.el5
libstdc+±4.1.2-50.el5
libstdc+±devel-4.1.2-50.el5
compat-libstdc+±33-3.2.3-61
compat-libstdc+±296-2.96-138

Dont remember exactly, How I got?

Any solutions?
Regards
Dev