<div dir="ltr">I cannot solve this problem by all the methods I know. I don't know why. Now I just reinstall llvm and clang, and it wokrs.<div>Thanks for your help!</div></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature"><br>--------------------------------------------<br>Qiuping Yi<br>Institute Of Software<br>Chinese Academy of Sciences</div></div>
<br><div class="gmail_quote">On Sat, Jan 16, 2016 at 1:39 PM, Matthew Brush via cfe-users <span dir="ltr"><<a href="mailto:cfe-users@lists.llvm.org" target="_blank">cfe-users@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 2016-01-15 8:36 PM, Qiuping Yi via cfe-users wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I use ubuntu,<br>
<br>
</blockquote>
<br>
I don't think Clang ever could find proper includes here. See the bugs like:<br>
<br>
<a href="https://bugs.launchpad.net/ubuntu/+source/llvm-defaults/+bug/1242300" rel="noreferrer" target="_blank">https://bugs.launchpad.net/ubuntu/+source/llvm-defaults/+bug/1242300</a><br>
<br>
It works fine, it just doesn't know where to find the correct stdlib headers, so you have to use an -I argument to tell it where your stdlib headers are (arch-specific on Debians/Ubuntus/etc).<br>
<br>
Cheers,<br>
Matthew Brush<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5">
$ uname -a<br>
Linux novice 3.11.0-15-generic #25~precise1-Ubuntu SMP Thu Jan 30 17:39:31<br>
UTC 2014 x86_64 x86_64 x86_64 GNU/Linux<br>
<br>
and this is the output of 'clang -v -c'<br>
<br>
$ clang -v -c test.c<br>
clang version 3.6.0 (tags/RELEASE_360/final)<br>
Target: x86_64-unknown-linux-gnu<br>
Thread model: posix<br>
  "/home/novice/installed/llvm-3.6.0.src/Release+Asserts/bin/clang" -cc1<br>
-triple x86_64-unknown-linux-gnu -emit-obj -mrelax-all -disable-free<br>
-main-file-name t1.c -mrelocation-model static -mthread-model posix<br>
-mdisable-fp-elim -fmath-errno -masm-verbose -mconstructor-aliases<br>
-munwind-tables -target-cpu x86-64 -v -dwarf-column-info -coverage-file<br>
/home/novice/installed/llvm-3.6.0.src/Release+Asserts/bin/t1.c<br>
-resource-dir<br>
"/home/novice/installed/llvm-3.6.0.src/Release+Asserts/bin/\${CLANG_RESOURCE_DIR}"<br>
-isysroot "\${DEFAULT_SYSROOT}" -c-isystem /home/novice/.install/include<br>
-cxx-isystem /home/novice/.install/include -internal-isystem<br>
"\${DEFAULT_SYSROOT}/usr/local/include" -internal-isystem<br>
"/home/novice/installed/llvm-3.6.0.src/Release+Asserts/bin/\${CLANG_RESOURCE_DIR}/include"<br>
-internal-externc-isystem "\${C_INCLUDE_DIRS}" -fdebug-compilation-dir<br>
/home/novice/installed/llvm-3.6.0.src/Release+Asserts/bin -ferror-limit 19<br>
-fmessage-length 205 -mstackrealign -fobjc-runtime=gcc<br>
-fdiagnostics-show-option -fcolor-diagnostics -o t1.o -x c<br>
/home/novice/installed/llvm-3.2.src/examples/test/t1.c<br>
clang -cc1 version 3.6.0 based upon ${BACKEND_PACKAGE_STRING} default<br>
target x86_64-unknown-linux-gnu<br>
ignoring nonexistent directory "/home/novice/.install/include"<br>
ignoring nonexistent directory "/home/novice/.install/include"<br>
ignoring nonexistent directory "${DEFAULT_SYSROOT}/usr/local/include"<br>
ignoring nonexistent directory<br>
"/home/novice/installed/llvm-3.6.0.src/Release+Asserts/bin/${CLANG_RESOURCE_DIR}/include"<br>
ignoring nonexistent directory "${C_INCLUDE_DIRS}"<br>
#include "..." search starts here:<br>
End of search list.<br>
/home/novice/installed/llvm-3.2.src/examples/test/t1.c:2:10: fatal error:<br>
'stdio.h' file not found<br>
#include <stdio.h><br>
          ^<br>
1 error generated.<br>
<br>
I put clang in llvm-3.6.0.src/toos/...<br>
<br>
<br>
--------------------------------------------<br>
Qiuping Yi<br>
Institute Of Software<br>
Chinese Academy of Sciences<br>
<br>
On Sat, Jan 16, 2016 at 12:56 AM, Hans Wennborg <<a href="mailto:hans@chromium.org" target="_blank">hans@chromium.org</a>> wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On Fri, Jan 15, 2016 at 7:06 AM, Qiuping Yi via cfe-users<br>
<<a href="mailto:cfe-users@lists.llvm.org" target="_blank">cfe-users@lists.llvm.org</a>> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hello All,<br>
<br>
I am a beginner of clang. I installed clang 3.6 with llvm 3.6, but I<br>
</blockquote>
found<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
my clang cannot work as expected.<br>
For the next simple program test.c:<br>
<br>
#include <stdio.h><br>
int main() {return 0;}<br>
<br>
$ clang -c test.c<br>
<br>
I got the next information:<br>
<br>
fatal error: 'stdio.h' file not found<br>
#include <stdio.h><br>
              ^<br>
1 error generated.<br>
<br>
what's wrong? I found other standard headers are also cannot be found.<br>
Any suggestion is OK. Thank you in advance.<br>
</blockquote>
<br>
What operating system are you using?<br>
<br>
What's the output of "clang -v -c test.c"?<br>
<br>
 From where did you install clang?<br>
<br>
</blockquote>
<br>
<br>
<br></div></div>
_______________________________________________<br>
cfe-users mailing list<br>
<a href="mailto:cfe-users@lists.llvm.org" target="_blank">cfe-users@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-users" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-users</a><br>
<br>
</blockquote>
<br>
_______________________________________________<br>
cfe-users mailing list<br>
<a href="mailto:cfe-users@lists.llvm.org" target="_blank">cfe-users@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-users" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-users</a><br>
</blockquote></div><br></div>