问题
I am trying to build Convert::ASN1 module but I get an error in the process. I am using Perl 5.12.0 on Solaris 10. perl Makefile.PL
runs without trouble, same for make
, but 'make test' throws this error:
MOST CRUCIAL PART OF IT IMO:
t/00prim.t ....... Can't load '/usr/local/lib/perl5/5.12.0/sun4-solari +s/auto/Socket
/Socket.so' for module Socket: ld.so.1: perl5.12.0: fata +l:
relocation error: file /usr/local/lib/perl5/5.12.0/sun4-solaris/au +to/Socket/Socket.so:
symbol inet_aton: referenced symbol not found at + /usr/local/lib/perl5/5.12.0/XSLoader.pm
line 70.
Same error occured when I tried to install IO::Socket. I think something must be wrong with the Socket core module. This is not all of the error log but the main part.
回答1:
Note: this answer is pure conjecture as I don't have a Solaris machine to test this on.
It looks like Solaris doesn't put inet_aton
in libsocket
, which is presumably what is being linked against when you build Socket
. Instead, it looks like you need to add -lresolv
to the LIBS
line in the Makefile (I don't know if this is in the Makefile.PL
for Socket
...).
Like I said, this is pure conjecture. I'm pulling this answer mostly from this bug report for DBMail. I hope it gets you somewhere, though.
回答2:
I don't have a Perl 5.12 installation, but I do have access to Solaris 10, and I can confirm that Solaris' libsocket does not have inet_aton
(it has inet_pton
instead).
But the resolver library (libresolv
) does have inet_aton, so a workaround may be to add
-lresolv
to the Makefile's LDFLAGS, and build/install it yourself outside of cpan.
来源:https://stackoverflow.com/questions/3751656/why-cant-i-build-perl-modules-that-load-socket-so-on-solaris-10