[LLVMdev] llvm library linking issues

Duncan Sands baldrick at free.fr
Tue Jul 17 00:44:58 PDT 2012


Hi Eugene,

On 17/07/12 03:46, Eugene wrote:
> I'm trying to make use of the llvm compiler libraries, but I can't get them to link to my program correctly.
>
> #include <llvm/Constants.h>
> #include <llvm/DerivedTypes.h>
>
>
> int main(){
>
>    llvm::APInt(1,0);
>
>    return 0;
> }
>
> I get an error like:
> undefined reference to `llvm::APInt::initSlowCase(unsigned int, unsigned long long, bool)

did you link with -lLLVMSupport (see the output of `llvm-config --libs
support`)?  What link command did you use?

Ciao, Duncan.

>
> (this function is called by the inline APInt constructor)
>
> The library seems to be found correctly; it doesn't give any other errors. Using nm I can see the mangled function initSlowCase exactly where I expect it to be. I'm out of ideas of that could be wrong.
>
> I'm using kubuntu 12.04. Same error occurs with both clang++ and g++. LLVM libraries are 3.1
> Any ideas on what might be the problem?
>
>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>





More information about the llvm-dev mailing list