[cfe-dev] How to setup a basic program using clang libs?

Sean Silva silvas at purdue.edu
Sat Jun 9 17:52:42 PDT 2012

The system headers thing is a major gotcha that really frustrated me when I
was first starting to program with clang. The reality is that the work of
setting up the default system headers is done by the Driver (or Frontend, I
forget which). Those parts of clang are separate from the Preprocessor, so
there is just no simple way to have it "just work" :(

The "usual" way to work around this is to run as a clang plugin. There are
docs about that at http://clang.llvm.org/docs/ClangPlugins.html

best of luck,
--Sean Silva

On Sat, Jun 9, 2012 at 2:22 PM, Bertjan Broeksema <broeksema at kde.org> wrote:

> Hi all,
> I'm trying to get known with using the clang libraries but I'm somewhat
> stuck. First of all most documentation (in particular tutorials) seem
> outdated, any pointers would be appreciated.
> Currently I've a simple program which does nothing more than setting up the
> preprocessor but it doesn't find standard include headers it seems.
> Probably
> I'm missing something trivial but I currently don't see what. Any help
> would
> be appreciated.
> For the context, I'm trying to write a little program that prints out the
> include tree of a source file.
> Cheers,
> Bertjan
> _______________________________________________
> 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/20120609/7c75f06e/attachment.html>

More information about the cfe-dev mailing list