trusteddomainproject / OpenDKIM

Other
97 stars 52 forks source link

ld: error: undefined symbol: freehostent AND getipnodebyname #90

Closed hdatma closed 4 years ago

hdatma commented 4 years ago
...
Making all in opendkim
...
libtool: link: /usr/bin/clang -pthread -Wempty-init-stmt -Wself-assign-field -Wself-assign -Wextra-semi -Wunreachable-code -Wdelete-non-virtual-dtor -Wzero-as-null-pointer-constant -Wnull-pointer-arithmetic -Wtautological-constant-compare -Wtautological-compare -Wpragma-pack -Wprotocol-property-synthesis-ambiguity -Wstrict-prototypes -Wunused-lambda-capture -fstack-protector-all -fno-omit-frame-pointer -fPIC -O2 -Wformat -Wformat-security -Werror=format-security -pthread -Wl,-z -Wl,relro -Wl,-z -Wl,now -o .libs/opendkim opendkim-opendkim.o opendkim-opendkim-ar.o opendkim-opendkim-arf.o opendkim-opendkim-crypto.o opendkim-opendkim-db.o opendkim-opendkim-dns.o opendkim-opendkim-lua.o opendkim-config.o opendkim-flowrate.o opendkim-reputation.o opendkim-stats.o opendkim-test.o opendkim-util.o -L/opt/openssl/lib -L/opt/libmilter/lib -L/opt/dkim/lib -L/opt/ldns/lib -L../libopendkim/.libs -lopendkim -lmilter -lunbound -L/opt/libexpat/lib -L/opt/libsodium/lib -lsodium -lldns -lssl -lcrypto -pthread -Wl,-rpath,/opt/dkim/lib -Wl,-rpath,/opt/dkim/lib -Wl,-rpath,/opt/libsodium/lib -Wl,-rpath,/opt/ldns/lib
ld: error: undefined symbol: freehostent
>>> referenced by listener.c:423
>>>               listener.o:(mi_opensocket) in archive /opt/libmilter/lib/libmilter.a

ld: error: undefined symbol: getipnodebyname
>>> referenced by sm_gethost.c:141
>>>               sm_gethost.o:(mi_gethostbyname) in archive /opt/libmilter/lib/libmilter.a

ld: error: undefined symbol: freehostent
>>> referenced by sm_gethost.c:153
>>>               sm_gethost.o:(mi_gethostbyname) in archive /opt/libmilter/lib/libmilter.a
clang: error: linker command failed with exit code 1 (use -v to see invocation)
*** Error 1 in opendkim (Makefile:984 'opendkim')
*** Error 1 in opendkim (Makefile:1805 'all-recursive')
*** Error 1 in . (Makefile:537 'all-recursive')
*** Error 2 in /opt/src/opendkim-2.11.0-Beta2 (Makefile:425 'all')

The is only one definition of freehostent in my system, in /usr/include/netdb.h. There is a missing "#include " in ... libmilter / sendmail 8.16.1:

listener.c:423:5: warning: implicit declaration of function 'freehostent' is invalid in C99 [-Wimplicit-function-declaration]
                                freehostent(hp);
                                ^
hdatma commented 4 years ago

Fixed.