mail build problem, libndb/sysdnsquery.c:423: undefined reference to `__dn_expand'

Issue #105 resolved
created an issue


cd $PLAN9/src/cmd/upas; mk install

as per mail/README fails:

for i in common smtp alias fs ned q send marshal vf misc do (cd $i; echo cd pwd';' mk $MKFLAGS install; mk $MKFLAGS install) done cd /home/tomas/sw/plan9port/src/cmd/upas/common; mk install mk: 'install' is up to date cd /home/tomas/sw/plan9port/src/cmd/upas/smtp; mk install for i in smtp smtpd do mk $MKFLAGS $i.install done 9l -o o.smtp mxdial.o smtp.o ../common/libcommon.a /home/tomas/sw/plan9port/src/libndb/sysdnsquery.c:423: undefined reference to __dn_expand' /home/tomas/sw/plan9port/src/libndb/sysdnsquery.c:164: undefined reference tores_search' /home/tomas/sw/plan9port/src/libndb/sysdnsquery.c:243: undefined reference to __dn_expand' /home/tomas/sw/plan9port/src/libndb/sysdnsquery.c:299: undefined reference todn_expand' collect2: ld returned 1 exit status mk: 9l -o o.smtp ... : exit status=exit(1) mk: for i in ... : exit status=exit(1) mk: for i in ... : exit status=exit(1) cd: exit 1

I think I need to add -lresolv to the linker 9l command somewhere, but not sure where it should go. I have the library installed...

uname -a Linux bela 3.2.0-30-generic #48-Ubuntu SMP Fri Aug 24 16:52:48 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux

Comments (4)

  1. thl reporter


    1) add "AUTOLIB(resolv)" in src/libndb/sysdnsquery.c as you advised.

    2) sudo apt-get install libbind-dev to get static library /usr/lib/x86_64-linux-gnu/libresolv.a

    3) sudo ln -s /usr/lib/x86_64-linux-gnu/libresolv.a /usr/lib/libresolv.a

    Then mail compilation worked fine.

    Thanks a lot!

  2. thl reporter

    diff -r f6c19873a236 src/libndb/sysdnsquery.c --- a/src/libndb/sysdnsquery.c Sat Sep 08 13:53:59 2012 -0400 +++ b/src/libndb/sysdnsquery.c Sat Sep 22 01:48:33 2012 +0200 @@ -9,6 +9,8 @@

    1. include <ndb.h>
    2. include "ndbhf.h"

    +AUTOLIB(resolv) + static void nstrcpy(char*, char*, int); static void mkptrname(char*, char*, int); static Ndbtuple *doquery(char*, char*);

  3. Log in to comment