<div dir="ltr"><div>This is because clang has some own headers.</div><div><br></div>Well sourceweb finds the headers because it uses the Clang Path to find the include directory (I guess).<div><a href="https://github.com/rprichard/sourceweb/blob/master/clang-indexer/main.cc#L398">https://github.com/rprichard/sourceweb/blob/master/clang-indexer/main.cc#L398</a> (see the comment there)<br>
</div><div><br></div><div>You can manually specify the include command (with the -I flag) for each Source-File in the compile_commands.json file.</div><div>In linux the path to the files is something like /usr/lib/clang/3.3/include or /usr/lib/llvm-3.4/include/clang/</div>
<div><br></div><div>Also look at this: <a href="http://clang.llvm.org/docs/FAQ.html#i-get-errors-about-some-headers-being-missing-stddef-h-stdarg-h">http://clang.llvm.org/docs/FAQ.html#i-get-errors-about-some-headers-being-missing-stddef-h-stdarg-h</a></div>
<div><br></div><div>Hope that helps,</div><div><br></div><div>Cheers</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">2013/11/4 rayjcwu <span dir="ltr"><<a href="mailto:rayjcwu@gmail.com" target="_blank">rayjcwu@gmail.com</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I change my target to gnu tools. Taking wget for example, I could build it by<br>
clang and I use  Bear <<a href="https://github.com/rizsotto/Bear" target="_blank">https://github.com/rizsotto/Bear</a>>   to generate<br>
compile_commands.json.<br>
When I use  my code<br>
<<a href="https://github.com/rayjcwu/clang.libtooling.annotator/blob/master/main.cpp" target="_blank">https://github.com/rayjcwu/clang.libtooling.annotator/blob/master/main.cpp</a>><br>
, which does nothing meanful except visiting, to visit all ast nodes in<br>
source code, I will get a lot of header files not found error.<br>
But I could use  sourceweb <<a href="https://github.com/rprichard/sourceweb" target="_blank">https://github.com/rprichard/sourceweb</a>>  , which<br>
is listed on exteral clang projects, to parse wget with the same .json file<br>
without any trouble. Even if I change my llvm/clang to version 3.2 the error<br>
still exists.<br>
<br>
Is there any quick possible solution for that before I tracing sourceweb<br>
source code?<br>
<br>
======<br>
1 error generated.<br>
Error while processing /home/jcwu/repos/wget-1.14/src/init.c.<br>
glthread/threadlib.c:19:10: fatal error: 'config.h' file not found<br>
#include <config.h><br>
         ^<br>
1 error generated.<br>
Error while processing /home/jcwu/repos/wget-1.14/lib/glthread/threadlib.c.<br>
In file included from ftp-basic.c:32:<br>
./wget.h:40:10: fatal error: 'config.h' file not found<br>
#include "config.h"<br>
         ^<br>
1 error generated.<br>
Error while processing /home/jcwu/repos/wget-1.14/src/ftp-basic.c.<br>
futimens.c:19:10: fatal error: 'config.h' file not found<br>
#include <config.h><br>
         ^<br>
1 error generated.<br>
Error while processing /home/jcwu/repos/wget-1.14/lib/futimens.c.<br>
stripslash.c:19:10: fatal error: 'config.h' file not found<br>
#include <config.h><br>
         ^<br>
1 error generated.<br>
Error while processing /home/jcwu/repos/wget-1.14/lib/stripslash.c.<br>
dup-safer-flag.c:21:10: fatal error: 'config.h' file not found<br>
#include <config.h><br>
         ^<br>
1 error generated.<br>
Error while processing /home/jcwu/repos/wget-1.14/lib/dup-safer-flag.c.<br>
In file included from html-parse.c:92:<br>
./wget.h:40:10: fatal error: 'config.h' file not found<br>
#include "config.h"<br>
         ^<br>
1 error generated.<br>
Error while processing /home/jcwu/repos/wget-1.14/src/html-parse.c.<br>
In file included from http.c:32:<br>
./wget.h:40:10: fatal error: 'config.h' file not found<br>
#include "config.h"<br>
         ^<br>
1 error generated.<br>
Error while processing /home/jcwu/repos/wget-1.14/src/http.c.<br>
In file included from recur.c:32:<br>
./wget.h:40:10: fatal error: 'config.h' file not found<br>
#include "config.h"<br>
         ^<br>
1 error generated.<br>
<br>
<br>
<br>
<br>
<br>
--<br>
View this message in context: <a href="http://clang-developers.42468.n3.nabble.com/How-to-use-libtooling-to-parse-multiple-files-at-once-and-succesfully-find-stddef-h-tp4035389p4035587.html" target="_blank">http://clang-developers.42468.n3.nabble.com/How-to-use-libtooling-to-parse-multiple-files-at-once-and-succesfully-find-stddef-h-tp4035389p4035587.html</a><br>

<div class="HOEnZb"><div class="h5">Sent from the Clang Developers mailing list archive at Nabble.com.<br>
_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br>
</div></div></blockquote></div><br></div>