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? thanks. Jun -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130105/36fef29c/attachment.html>
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>*/
On Sat, Jan 5, 2013 at 9:22 PM, Dmitri Gribenko <gribozavr at gmail.com> wrote:> 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. > >yes, that solves the problem, thanks! Jun -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130106/9e3430a7/attachment.html>