Glam Prestige Journal

Bright entertainment trends with youth appeal.

I'm trying to port a project that uses Clang's LibTooling library from Arch to Ubuntu/Debian. I have installed the clang-10, llvm-10 and libclang-10-dev packages. The latter installs the necessary headers to /usr/lib/llvm-10/include/clang/ (i.e. usr/lib/llvm-10/include/clang/Tooling/Tooling.h). However, trying to link a program that uses these headers results in various linking errors such as:

undefined reference to `clang::ast_matchers::internal::DynTypedMatcher::matches(clang::ast_type_traits::DynTypedNode const&, clang::ast_matchers::internal::ASTMatchFinder*, clang::ast_matchers::internal::BoundNodesTreeBuilder*) const'

Under Arch I can resolve this with -lclang-cpp but no such library exists under Ubuntu. Several posts on StackOverflow recommend linking to various other libraries, so I have als tried:

-lclangFrontendTool -lclangFrontend -lclangDriver -lclangSerialization -lclangCodeGen -lclangParse -lclangSema -lclangStaticAnalyzerFrontend -lclangStaticAnalyzerCheckers -lclangStaticAnalyzerCore -lclangAnalysis -lclangARCMigrate -lclangRewriteFrontend -lclangEdit -lclangAST -lclangLex -lclangBasic

But that does not work either. Are the libclang-*-dev packages incomplete/broken? Am I missing yet another package? Or am I just linking against the wrong libraries?

4 Reset to default

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy