[cfe-dev] Issue with installation of Clang

Jan Bierbaum s3306700 at inf.tu-dresden.de
Thu Aug 19 15:41:58 PDT 2010


Hi!

Shashank Melkote meinte am 20.08.2010 00:13:
> when I run this bit of code using
> g++ tut1.cpp -g -fno-rtti `llvm-config --cxxflags --ldflags --libs`
> -L/usr/local/lib -lclangBasic -lclangLex -lclangDriver -lclangFrontend
> -lclangParse -lclangAST -lclangSema -lclangAnalysis

Try this one:

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

1) You did not specify all of Clang's libs. I don't really know which
ones are actually needed, but the linker should be smart enough to only
include those.

2) Always put the llvm libs after the Clang libs. Clang's libs use the
llvm ones and the linker will only check for open references in libs
given "down" the command line. Took me some time to learn that... ;-)


Regards, Jan.



More information about the cfe-dev mailing list