[LLVMdev] fail to compile my code on 3.2

Dmitri Gribenko gribozavr at gmail.com
Sat Jan 5 06:22:11 PST 2013


On Sat, Jan 5, 2013 at 9:18 AM, Jun Koi <junkoi2004 at gmail.com> wrote:
> hi,
>
> my old code compiles well on 3.1, but fails on 3.2.
> the compile error is like below.
>
>
> ...
> g++ -o vc main.o `llvm-config --libs all --ldflags`
> /usr/lib/libLLVMSupport.a(Signals.o): In function `PrintStackTrace(void*)':
> Signals.cpp:(.text+0x6c8): undefined reference to `dladdr'
> Signals.cpp:(.text+0x749): undefined reference to `dladdr'
> collect2: error: ld returned 1 exit status
> make: *** [vc] Error 1
>
>
> this is on Ubuntu 12.4, 64-bit. any idea on how to fix this?

Adding -ldl explicitly might help.

Dmitri

-- 
main(i,j){for(i=2;;i++){for(j=2;j<i;j++){if(!(i%j)){j=0;break;}}if
(j){printf("%d\n",i);}}} /*Dmitri Gribenko <gribozavr at gmail.com>*/



More information about the llvm-dev mailing list