Use of clang

Hi,

I want to use clang as library to parsing C files. But i don’t
found any user guide to follow it. For this reason i send this mail
to ask you to help me.
In my project i download the source code of clang and i just write i
simple file.c to do a simple printf. but i include many header file
from the clang directory. I do g++ file .c
but many error appear.
My questions:
1- what should i do to include files from clang source code in my
file and complie it with g++?
2- Can i compile the source code of clang to obtain a librairy with
gcc compliler if no why ?
2- Can any bady give me a simple tutorial that explain hwo to use the
source code of clang in my project?
I need your help please answer me.

My best Regards

You should start by reading documentation in the “using-clang-as-a-library” section at http://clang.llvm.org/docs/#using-clang-as-a-library.

It will tell you about the different ways to use clang as a library, and point you at a couple of samples.