linker errors against clang/llvm libraries


I am using Linux Mint 15 Olivia, and I installed the clang compiler and libclang-dev packages available in the repositories, they are version 3.2.

I am trying to compile and link the example from clang repository as you can see it’s from clang version 3.2.

When I compiled it with the command:

I'm afraid llvm-config does not know anything about clang libraries,
they need to be added separately. Alternatively, it would be nice if
we had clang-config (or a similar utility).


I looked at an example from the Makefiles clang/tools, and the final command line was

clang++ `llvm-config --ldflags` main.o -lclangFrontendTool -lclangFrontend -lclangDriver -lclangSerialization -lclangCodeGen -lclangParse -lclangSema -lclangStaticAnalyzerFrontend -lclangStaticAnalyzerCheckers -lclangStaticAnalyzerCore -lclangAnalysis -lclangARCMigrate -lclangRewriteFrontend -lclangRewriteCore -lclangEdit -lclangAST -lclangLex -lclangBasic `llvm-config --libs`

Now it compiles :slight_smile:

Such a silly mistake, but I appreciate your response, it made me see my mistake.