Python2.4: building '_socket' extension fails with `INET_ADDRSTRLEN' undeclared

"Martin v. Löwis" martin at v.loewis.de
Fri Dec 3 18:37:43 EST 2004


Michael Ströder wrote:
> I'm trying to build Python2.4 on a rather old Debian machine. I only 
> have a shell account there. That's why I'm very limited in my actions.
> 
> Building _socket fails (see below) although I tried to use
> 
> configure --disable-ipv6
> 
> Any clue?

Hard to say, since you don't indicate what clues you are lacking.

In general, when the C compiler gives an error message, it is best
to try to understand the error message. The message reads

socketmodule.c:3350: `INET_ADDRSTRLEN' undeclared (first use this function)

This apparently refers to the line

char ip[INET_ADDRSTRLEN + 1];

which is part of the block

#ifdef ENABLE_IPV6
         char ip[MAX(INET_ADDRSTRLEN, INET6_ADDRSTRLEN) + 1];
#else
         char ip[INET_ADDRSTRLEN + 1];
#endif

So it appears that on your system, INET_ADDRSTRLEN is not defined,
even if it is supposed to be defined on all systems, regardless
of whether they support IPv6.

Looking at a more recent system in /usr/include, I get

/usr/include$ grep -r ADDRSTRLEN .
./netinet/in.h:#define INET_ADDRSTRLEN 16

This is a clue, I think.

Regards,
Martin



More information about the Python-list mailing list