[cfe-dev] How to use libtooling to parse multiple files at once? and succesfully find stddef.h?

Manuel Klimek klimek at google.com
Mon Nov 4 04:17:05 PST 2013


I'd run your normal build in verbose mode, and compare the command lines
you get to what you find in compile_commands.json.


On Mon, Nov 4, 2013 at 3:48 AM, rayjcwu <rayjcwu at gmail.com> wrote:

> I change my target to gnu tools. Taking wget for example, I could build it
> by
> clang and I use  Bear <https://github.com/rizsotto/Bear>   to generate
> compile_commands.json.
> When I use  my code
> <
> https://github.com/rayjcwu/clang.libtooling.annotator/blob/master/main.cpp
> >
> , which does nothing meanful except visiting, to visit all ast nodes in
> source code, I will get a lot of header files not found error.
> But I could use  sourceweb <https://github.com/rprichard/sourceweb>  ,
> which
> is listed on exteral clang projects, to parse wget with the same .json file
> without any trouble. Even if I change my llvm/clang to version 3.2 the
> error
> still exists.
>
> Is there any quick possible solution for that before I tracing sourceweb
> source code?
>
> ======
> 1 error generated.
> Error while processing /home/jcwu/repos/wget-1.14/src/init.c.
> glthread/threadlib.c:19:10: fatal error: 'config.h' file not found
> #include <config.h>
>          ^
> 1 error generated.
> Error while processing /home/jcwu/repos/wget-1.14/lib/glthread/threadlib.c.
> In file included from ftp-basic.c:32:
> ./wget.h:40:10: fatal error: 'config.h' file not found
> #include "config.h"
>          ^
> 1 error generated.
> Error while processing /home/jcwu/repos/wget-1.14/src/ftp-basic.c.
> futimens.c:19:10: fatal error: 'config.h' file not found
> #include <config.h>
>          ^
> 1 error generated.
> Error while processing /home/jcwu/repos/wget-1.14/lib/futimens.c.
> stripslash.c:19:10: fatal error: 'config.h' file not found
> #include <config.h>
>          ^
> 1 error generated.
> Error while processing /home/jcwu/repos/wget-1.14/lib/stripslash.c.
> dup-safer-flag.c:21:10: fatal error: 'config.h' file not found
> #include <config.h>
>          ^
> 1 error generated.
> Error while processing /home/jcwu/repos/wget-1.14/lib/dup-safer-flag.c.
> In file included from html-parse.c:92:
> ./wget.h:40:10: fatal error: 'config.h' file not found
> #include "config.h"
>          ^
> 1 error generated.
> Error while processing /home/jcwu/repos/wget-1.14/src/html-parse.c.
> In file included from http.c:32:
> ./wget.h:40:10: fatal error: 'config.h' file not found
> #include "config.h"
>          ^
> 1 error generated.
> Error while processing /home/jcwu/repos/wget-1.14/src/http.c.
> In file included from recur.c:32:
> ./wget.h:40:10: fatal error: 'config.h' file not found
> #include "config.h"
>          ^
> 1 error generated.
>
>
>
>
>
> --
> View this message in context:
> http://clang-developers.42468.n3.nabble.com/How-to-use-libtooling-to-parse-multiple-files-at-once-and-succesfully-find-stddef-h-tp4035389p4035587.html
> Sent from the Clang Developers mailing list archive at Nabble.com.
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20131104/80091874/attachment.html>


More information about the cfe-dev mailing list