[cfe-dev] help on Building simple clang application

Sebastian Redl sebastian.redl at getdesigned.at
Thu Jun 10 01:01:07 PDT 2010


Seth Burleigh wrote:
> Woops, automatically pressed enter! lol, heres the code and errors:
>
>
>
>
> g++ tut1.cpp -g -fno-rtti `llvm-config --cxxflags --ldflags --libs`
> -lclangBasic -lclangLex -lclangDriver -lclangFrontend -lclangParse
> -lclangAST -lclangSema -lclangAnalysis
>   
The order of Clang libraries is wrong. A library must be named after the
libraries that depend on it, so, for example, -lclangBasic must be the
last lib option, because everything else depends on it.
I'm not quite sure how the Clang dependencies work exactly, but try this
command line:

g++ tut1.cpp -g -fno-rtti
 -lclangDriver -lclangAnalysis -lclangFrontend
 -lclangSema -lclangAST -lclangParse -lclangLex
 -lclangBasic `llvm-config --cxxflags --ldflags --libs`

Sebastian




More information about the cfe-dev mailing list