[cfe-users] clang++ won't compile any c++ headers

Andrew Jarcho andrew.jarcho at gmail.com
Sat Apr 27 10:40:32 PDT 2013


Hi List,

I'm running Fedora 17 64-bit on a Dell Inspiron laptop.
LLVM is v3.1, clang is v3.0, gcc is v4.7.2

My input file named testr001.cpp is:

#include <iostream>
using namespace std;

int main()
{
}

When compiled with
g++ testr001.cpp
there is no problem.

When compiled with
clang++ testr001.cpp
I get the following message:

==========
In file included from testr001.cpp:1:
In file included from
/usr/bin/../lib/gcc/x86_64-redhat-linux/4.7.2/../../../../include/c++/4.7.2/iostream:39:
In file included from
/usr/bin/../lib/gcc/x86_64-redhat-linux/4.7.2/../../../../include/c++/4.7.2/ostream:39:
In file included from
/usr/bin/../lib/gcc/x86_64-redhat-linux/4.7.2/../../../../include/c++/4.7.2/ios:42:
In file included from
/usr/bin/../lib/gcc/x86_64-redhat-linux/4.7.2/../../../../include/c++/4.7.2/bits/ios_base.h:40:
/usr/bin/../lib/gcc/x86_64-redhat-linux/4.7.2/../../../../include/c++/4.7.2/ext/atomicity.h:48:45:
error:
      use of undeclared identifier '__ATOMIC_ACQ_REL'
  { return __atomic_fetch_add(__mem, __val, __ATOMIC_ACQ_REL); }
                                            ^
/usr/bin/../lib/gcc/x86_64-redhat-linux/4.7.2/../../../../include/c++/4.7.2/ext/atomicity.h:52:38:
error:
      use of undeclared identifier '__ATOMIC_ACQ_REL'
  { __atomic_fetch_add(__mem, __val, __ATOMIC_ACQ_REL); }
                                     ^
2 errors generated.
==========

Clang++ produces errors when compiling any .cpp file containing C++ headers
such as <iostream>,
but compiles just fine when I use only C headers such as <stdio.h>.

I've done plenty of Googling on this problem, and looked at llvm.clang.org,
but I'm still confused.
I'd like to know what's wrong with my setup before I try and "fix" it. :-)

Can anybody help?

TIA,
Andy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-users/attachments/20130427/152e7c5e/attachment.html>


More information about the cfe-users mailing list