Originally Posted by TommyC7
Yep, it worked before the gcc and other upgrades though. Although, even then clang wouldn't compile C++ code either (and llvm/clang still gets similar errors when attempting to compile C++ code):
using namespace std;
cout << "Hello World!\n";
I think Pat and crew know about this, though. ponce or pprkut (curse your similar names!) on IRC said this was found just after 14.0 came out (C++ code not compiling that is).
Clang 3.2 came out 20 days ago (to the date of this post), so I think if we wait patiently we'll get it in -current and perhaps it'll fix the problems (I read somewhere that a newer clang/llvm will fix it).
After further research on google: clang "fatal error:" "file not found"
It looks like all different versions of clang on all different platforms can fail with this error.
And after using the "-v" option of clang, I found the problem.
$ clang -v hello.c
clang version 3.0 (tags/RELEASE_30/final)
Thread model: posix
"/usr/bin/clang" -cc1 -triple x86_64-slackware-linux-gnu -emit-obj -mrelax-all -disable-free -disable-llvm-verifier -main-file-name hello.c -mrelocation-model static -mdisable-fp-elim -masm-verbose -mconstructor-aliases -munwind-tables -target-cpu x86-64 -target-linker-version 22.214.171.124.2.20120424 -momit-leaf-frame-pointer -v -resource-dir /usr/bin/../lib/clang/3.0 -fmodule-cache-path /var/tmp/clang-module-cache -cxx-isystem /usr/lib64/qt/include -cxx-isystem /usr/lib64/qt/include -internal-isystem /usr/local/include -internal-isystem /usr/bin/../lib/clang/3.0/include -internal-externc-isystem /usr/include/ -internal-externc-isystem /usr/lib64/gcc/x86_64-slackware-linux/4.7.1//include/ -internal-externc-isystem /usr/lib64/gcc/x86_64-slackware-linux/4.7.1//include-fixed/ -ferror-limit 19 -fmessage-length 121 -fgnu-runtime -fobjc-runtime-has-arc -fobjc-runtime-has-weak -fobjc-fragile-abi -fdiagnostics-show-option -fcolor-diagnostics -o /tmp/hello-YoK0jd.o -x c hello.c
clang -cc1 version 3.0 based upon llvm 3.0 hosted on x86_64-slackware-linux-gnu
ignoring nonexistent directory "/usr/bin/../lib/clang/3.0/include"
ignoring nonexistent directory "/usr/lib64/gcc/x86_64-slackware-linux/4.7.1//include/"
ignoring nonexistent directory "/usr/lib64/gcc/x86_64-slackware-linux/4.7.1//include-fixed/"
#include "..." search starts here:
#include <...> search starts here:
End of search list.
In file included from hello.c:1:
/usr/include/stdio.h:34:11: fatal error: 'stddef.h' file not found
# include <stddef.h>
1 error generated.
The current installation of clang is dependent on gcc 4.7.1, but Slackware current uses gcc 4.7.2
This means that clang must be re-built every time that gcc changes and I suspect that this is true for g++ and any other compiler that clang might use.