clang++ cannot compile even a hello world program in Fedora 17!!!
你们都说clang好,于是我就十分想试一试。我手上的机器只有fedora 17、CentOS 4/5/6。CentOS的repositories里面没有clang。但是fedora 17里面有,于是我就兴致勃勃的装了一个。结果发现,连最简单的Hello World都编译不过去。
[changming@test 1]$ clang++ hello.cpp
In file included from hello.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.
[changming@test14 1]$ clang hello.cpp
In file included from hello.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); }
补充:软件开发 , C++ ,