Tuesday, December 29, 2009

can't install mtr in Leopard

I was unable to compile mtr in OS X Leopard, getting these errors on make:

dns.c:242: error: ‘PACKETSZ’ undeclared here (not in a function)
dns.c: In function ‘statmalloc’:
dns.c:318: warning: format ‘%u’ expects type ‘unsigned int’, but argument 3 has type ‘size_t’
dns.c: In function ‘dorequest’:
dns.c:756: error: ‘QUERY’ undeclared (first use in this function)
dns.c:756: error: (Each undeclared identifier is reported only once
dns.c:756: error: for each function it appears in.)
dns.c:756: error: ‘C_IN’ undeclared (first use in this function)
dns.c: In function ‘resendrequest’:
dns.c:769: error: ‘T_A’ undeclared (first use in this function)
dns.c:776: error: ‘T_PTR’ undeclared (first use in this function)
dns.c: In function ‘parserespacket’:
dns.c:866: error: ‘NOERROR’ undeclared (first use in this function)
dns.c:893: error: ‘MAXDNAME’ undeclared (first use in this function)
dns.c:918: error: ‘C_IN’ undeclared (first use in this function)
dns.c:925: error: ‘T_PTR’ undeclared (first use in this function)
dns.c:992: error: ‘T_A’ undeclared (first use in this function)
dns.c:1063: error: ‘NXDOMAIN’ undeclared (first use in this function)
dns.c: In function ‘dns_events’:
dns.c:1129: error: ‘T_PTR’ undeclared (first use in this function)
dns.c: In function ‘dns_lookup2’:
dns.c:1188: error: ‘T_PTR’ undeclared (first use in this function)
make[2]: *** [dns.o] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all-recursive-am] Error 2


... the solution was to add "-lresolv" to the LIBS line:
LIBS = -lm -ltermcap -lresolv

inspired by the same issue with php 5.3.0

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.