HowToUseLLJIT example doesn't find targets for this triple.


I’m trying to run the “HowToUseLLJIT” example in LLVM project, but it results in the message: “Unable to find target for this triple (no targets are registered)”.

I have been trying to find information on this but I have been unable to find a fix or the reason this happens.

Moreover, If i add “InitializeAllTargetInfos();” it results in: “No available targets are compatible with triple ‘x86_64-pc-windows-msvc’”.

I’m using Visual Studio 2019 to compile my project. Please let me know if you need any more info I can provide.


Typically this is the result of not compiling the target backend.
Check the value of CMake's LLVM_TARGETS_TO_BUILD. It should be "X86"
or "all".