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

rayjcwu rayjcwu at gmail.com
Tue Oct 29 20:54:30 PDT 2013


Edwin Vane replied me says compilation database should be self contained.
First I need to make sure the compile_commands.json is generated with using
clang and I could use clang to build opencv. 

I set these environment variables

export CC=/home/jcwu/repos/llvm-release/Release/bin/clang
export CXX=/home/jcwu/repos/llvm-release/Release/bin/clang++
export
C_INCLUDE_PATH=/usr/local/include:/home/jcwu/repos/llvm-release/Release/lib/clang/3.4/include:/usr/include/x86_64-linux-gnu:/usr/include 
# these are from clang -v -c files.cpp
export
CPLUS_INCLUDE_PATH=/usr/local/include:/home/jcwu/repos/llvm-release/Release/lib/clang/3.4/include:/usr/include/x86_64-linux-gnu:/usr/include

then regenerate compile_commands.json, it could find stddef.h but new issue
comes up

[ 31%] Building CXX object modules/ts/CMakeFiles/opencv_ts.dir/src/ts.cpp.o
In file included from /home/jcwu/repos/opencv/modules/ts/src/ts.cpp:116:
/usr/include/setjmp.h:60:12: error: conflicting types for '__sigsetjmp'
extern int __sigsetjmp (struct __jmp_buf_tag __env[1], int __savemask)
__THROWNL;
           ^
/usr/include/pthread.h:727:12: note: previous declaration is here
extern int __sigsetjmp (struct __jmp_buf_tag *__env, int __savemask)
__THROW;
           ^
1 error generated.
make[2]: *** [modules/ts/CMakeFiles/opencv_ts.dir/src/ts.cpp.o] Error 1
make[1]: *** [modules/ts/CMakeFiles/opencv_ts.dir/all] Error 2
make: *** [all] Error 2

I can't use clang to build opencv due to a type conflict or two system
header files.
Havne't figured out how to solve this.



--
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-tp4035389p4035422.html
Sent from the Clang Developers mailing list archive at Nabble.com.



More information about the cfe-dev mailing list