[llvm-dev] Link error: undefined reference to APIInt functions

Krzysztof Parzyszek via llvm-dev llvm-dev at lists.llvm.org
Tue Sep 12 13:34:15 PDT 2017


You need to link libLLVMSupport.a with your program.

-Krzysztof

On 9/12/2017 12:26 PM, Hayrapetyan, Anahit via llvm-dev wrote:
> Hi,
> 
> 
> I’m getting link error when compiling an executable where llvm::APIInt 
> is used.
> 
> Following is the error:
> 
> 
> /usr/local/include/llvm/ADT/APInt.h:1372: undefined reference to 
> `llvm::APInt::countLeadingZerosSlowCase() const'
> 
> The source file is a simple program, where ConstantInt’s getZExtValue 
> function is called. If I comment out this part, everything goes just fine.
> 
> 
> uint64_t val = or_const_op->getZExtValue();
> 
> 
> Could you please suggest what the cause of this problem might be?
> 
> 
> Thanks,
> 
> Anahit.
> 
> 
> 
> 
> 
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
> 

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, 
hosted by The Linux Foundation


More information about the llvm-dev mailing list