(Answer) (Category) OpenLDAP Faq-O-Matic : (Category) Trash : (Answer) Error on make: gai_strerror() not found
Problem:        On installing OpenLDAP-2.0.7, make yielded an unreferenced
                symbol gai_strerror() in daemon.c
Reason:         1. There is no gai_strerror() function on my SuSE Linux 2.2.7.
                2. configure realized it (HAVE_GAI_STRERROR not defined)
                3. but: in servers/slapd/daemon.c, line 243, gai_strerror
                   is hard coded.
Fix:            Parametrize it as GAI_STRERROR like AC_GAI_STRERROR in
                include/ac/socket.h

See these outputs from diff:

make/openldap-2.0.7> diff servers/slapd/slap.h servers/slapd/slap.h.orig
1187,1196d1186
< /* added to circumvent hard coded gai_strerror() in daemon.c: */
< #ifdef HAVE_GETADDRINFO
< #     ifdef HAVE_GAI_STRERROR
< #           define GAI_STRERROR(x)    (gai_strerror((x)))
< #     else
< #           define GAI_STRERROR(x)    (ldap_pvt_gai_strerror((x)))
<             char * ldap_pvt_gai_strerror( int );
< #     endif
< #endif
< 
make/openldap-2.0.7> diff servers/slapd/daemon.c servers/slapd/daemon.c.orig
243c243
<                     GAI_STRERROR(err), 0, 0);
---
>                     gai_strerror(err), 0, 0);
udo.bellack@swn.de
[Append to This Answer]
This document is: http://www.openldap.org/faq/index.cgi?file=541
[Search] [Appearance]
This is a Faq-O-Matic 2.721.test.
© Copyright 1998-2013, OpenLDAP Foundation, info@OpenLDAP.org