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

rayjcwu rayjcwu at gmail.com
Sun Nov 3 18:48:00 PST 2013


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.



More information about the cfe-dev mailing list