[cfe-dev] clang++

Devchandra L Meetei dlmeetei at gmail.com
Wed Mar 16 01:50:49 PDT 2011


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 at 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 at 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<char>    string;
          ^
/usr/include/c++/4.4.4/bits/stringfwd.h:55:23: error: expected
unqualified-id
  typedef basic_string<char>    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 at delmeetei bin]$
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20110316/6603e2ff/attachment.html>


More information about the cfe-dev mailing list