<div dir="ltr">Hi List,<div><br></div><div style>I'm running Fedora 17 64-bit on a Dell Inspiron laptop.</div><div style>LLVM is v3.1, clang is v3.0, gcc is v4.7.2</div><div style><br></div><div style>My input file named testr001.cpp is:</div>
<div style><br></div><div style>#include <iostream></div><div style>using namespace std;</div><div style><br></div><div style>int main()</div><div style>{</div><div style>}</div><div style><br></div><div style>When compiled with </div>
<div style>g++ testr001.cpp</div><div style>there is no problem.</div><div style><br></div><div style>When compiled with</div><div style>clang++ testr001.cpp</div><div style>I get the following message:</div><div style><br>
</div><div style>==========</div><div style><div>In file included from testr001.cpp:1:</div><div>In file included from /usr/bin/../lib/gcc/x86_64-redhat-linux/4.7.2/../../../../include/c++/4.7.2/iostream:39:</div><div>In file included from /usr/bin/../lib/gcc/x86_64-redhat-linux/4.7.2/../../../../include/c++/4.7.2/ostream:39:</div>
<div>In file included from /usr/bin/../lib/gcc/x86_64-redhat-linux/4.7.2/../../../../include/c++/4.7.2/ios:42:</div><div>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:</div>
<div>/usr/bin/../lib/gcc/x86_64-redhat-linux/4.7.2/../../../../include/c++/4.7.2/ext/atomicity.h:48:45: error: </div><div> use of undeclared identifier '__ATOMIC_ACQ_REL'</div><div> { return __atomic_fetch_add(__mem, __val, __ATOMIC_ACQ_REL); }</div>
<div> ^</div><div>/usr/bin/../lib/gcc/x86_64-redhat-linux/4.7.2/../../../../include/c++/4.7.2/ext/atomicity.h:52:38: error: </div><div> use of undeclared identifier '__ATOMIC_ACQ_REL'</div>
<div> { __atomic_fetch_add(__mem, __val, __ATOMIC_ACQ_REL); }</div><div> ^</div><div>2 errors generated.</div><div>==========</div></div><div style><br></div><div style>Clang++ produces errors when compiling any .cpp file containing C++ headers such as <iostream>,</div>
<div style>but compiles just fine when I use only C headers such as <stdio.h>.</div><div style><br></div><div style>I've done plenty of Googling on this problem, and looked at <a href="http://llvm.clang.org">llvm.clang.org</a>, but I'm still confused.</div>
<div style>I'd like to know what's wrong with my setup before I try and "fix" it. :-)</div><div style><br></div><div style>Can anybody help?</div><div style><br></div><div style>TIA,</div><div style>Andy</div>
<div style><br></div></div>