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

Michael Ströder michael at
Sat Dec 4 09:47:12 CET 2004

Martin v. Löwis wrote:
> 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.

My wanted clue: How to build it without modifying the Python 2.4 sources?

> 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)

Thanks for your answer. I do understand the message. I searched some 
archives and found similar bug reports in the SF issue tracker which 
were for Python 2.3 on Irix and seemed to be fixed.

> Looking at a more recent system in /usr/include, I get
> /usr/include$ grep -r ADDRSTRLEN .
> ./netinet/in.h:#define INET_ADDRSTRLEN 16

Note that building Python2.2 worked on the very same machine. I've added


to socketmodule.h and it worked. But I think there might be something 
wrong with the autoconf stuff.

I filed bug [ 1078245 ]:

Ciao, Michael.

More information about the Python-list mailing list