Undefined reference only when including ASTMatchers

I am trying to learn the Clang Frontend and I am trying to follow the documentations on Tutorial for building tools using LibTooling and LibASTMatchers — Clang 16.0.0git documentation. The issue I have is that the second I include ASTMatchers.h or ASTMatchFinder.h I get a list of undefined references to some llvm::omp and some other things aswell. If I remove the includes and only include the basics like Tooling.h and FrontendActions.h the file gets compiled without an issue.

WITH ERRORS:

I’ve been trying everything, linked all the possible libraries for clang aswell.

Not sure what to do anymore, would love to get some help, i’m on the edge of crying after trying to solve this the whole day.

Issue got solved.

Apparently you only need to link to clang-cpp.a and LLVM-14.dll and nothing else. There was no information about this anywhere though, but everything is working now.