php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #2898 symbol `inet_aton' is multiply defined
Submitted: 1999-12-02 20:36 UTC Modified: 1999-12-03 22:05 UTC
From: sroberts at snap dot com Assigned:
Status: Closed Package: Compile Failure
PHP Version: 4.0 Latest CVS (02/12/1999) OS: Solaris 2.5.1
Private report: No CVE-ID: None
 [1999-12-02 20:36 UTC] sroberts at snap dot com
Trying to compile latest CVS, and it gets a few warnings during compilation (detailed below), before bombing trying to link apache with :

ld: fatal: symbol `inet_aton' is multiply defined:
        (file modules/php4/libphp4.a(flock_compat.o) and file /usr/local/lib/libresolv.a(inet_addr.o));

This is building with sybase and apache 1.3.9 (I'll try it without sybase now). Probably a build/compiler/lib issue, since resolv doesn't work on the existing (installed) 3.0.12 (but I don't know who built that). This is gcc-2.9.2 which seems to work fine for other major compilations here.

Probably unrelated, warnings:

 - ~20 warnings of "assignment makes pointer from integer without a cast", all calling
     localtime_r()
     gmtime_r()
     strtok_r
 --> the code _looks_ okay. weird.

 - "fsock.c:210  passing arg 4 of `getsockopt' from incompatible pointer type"
 --> passes a *int when it should be a *char



Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [1999-12-02 21:16 UTC] sroberts at snap dot com
Looks like the link failure is probably because of the bogus Solaris flock (see #2167, and thread on php-dev starting at http://www.progressive-comp.com/Lists/?l=php-dev&m=93568898226248&w=2)

Any ideas on how I fix it?
 [1999-12-03 10:18 UTC] sas at cvs dot php dot net
(warnings related to *_r fixed)

I cannot reproduce the inet_aton problem on Solaris 7. What does 

$ grep INET_ATON php_config.h

output?
 [1999-12-03 13:30 UTC] sroberts at snap dot com
The grep returns :
/* #undef HAVE_INET_ATON */

Thanks for those fixes, I'll get the latest CVS and try again...  BTW, configure said :

checking for gethostname in -lnsl... (cached) yes  
checking for socket in -lsocket... (cached) yes
checking for gethostbyaddr in -lnsl... (cached) yes
checking for crypt in -lcrypt... (cached) yes
checking for sin in -lm... (cached) yes
checking for res_search in -lsocket... (cached) no
checking for res_search in -lresolv... (cached) no
checking for dn_skipname in -lresolv... (cached) no
checking for __dn_skipname in -lresolv... (cached) yes  
...
checking for gethostbyaddr... (cached) no
...
checking for inet_aton... (cached) no 
...
checking for struct flock... yes
checking for flock... (cached) no

Doesn't that mean configure is (incorrectly?) thinking that we don't have inet_aton?

 [1999-12-03 13:54 UTC] sas at cvs dot php dot net
PHP checks for inet_aton in libresolv now. Thanks for your feedback.
 [1999-12-03 22:05 UTC] sroberts at snap dot com
Problem still exists (configure still fails to find it - it was using libresolv before anyway so the additional check in configure can probably be undone).

checking for inet_aton in -lresolv... no
checking for inet_aton... no
checking for inet_aton in -lbind... no

Looking at the config.log it explains :

configure:2548: checking for inet_aton in -lresolv
configure:2567: gcc -o conftest -g -O2   conftest.c -lresolv  -lm  1>&5
Undefined                       first referenced
 symbol                             in file
htonl                               /usr/local/lib/libresolv.a(inet_addr.o)

So it needs htonl() which is in libsocket.


 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Mon Oct 12 09:00:02 2026 UTC