Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

XS.c: loadable library and perl binaries are mismatched (got handshake key 0xce00080, needed 0xdb80080)

Tags:

perl

I was using perl5 and executing my script

perl myscript.R 

and was getting following error.

Can't locate local/lib.pm in @INC (you may need to install the local::lib module) (@INC contains: /kb/deployment/lib /kb/deployment/lib/perl5 /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.24.1 /usr/local/share/perl/5.24.1 /usr/lib/x86_64-linux-gnu/perl5/5.24 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.24 /usr/share/perl/5.24 /usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base).
BEGIN failed--compilation aborted.

so i installed local::lib using following command

cpan local::lib

but after i tried to use the perl myscript.pl and getting

  XS.c: loadable library and perl binaries are mismatched (got handshake key 0xce00080, needed 0xdb80080)

I am clueless about fixing thsi issue.

like image 989
Manish Avatar asked Oct 25 '25 05:10

Manish


1 Answers

The version of the binary component and the version of the Perl component of the module you are trying to load don't match.

You appear to have used local::lib to install modules in your home dir. Upgrading your perl causes this setup to fail badly. The solution is to delete ~/perl5[1] and reinstall the modules you had locally installed.


What if you have more than one build of Perl or you don't want to have this problem the next time you upgrade Perl?

There are ways of telling the installers to install modules in your home dir in such a way that multiple builds of Perl can share the installation directory,[2] but it doesn't really work.[3]

This is why I use perlbrew to install Perl itself in my home dir so I don't have to override the installation location of modules. Using perlbrew has the following benefits:

  • You can have multiple builds of Perl installed without hassle.
  • You can upgrade Perl when you want to, independent of OS updates.
  • You can test scripts and modules with newer versions of Perl before switching to using it "permanently".
  • You can test scripts and modules with older versions of Perl.

  1. Well, rename it until you're sure you're done with it.
  2. By passing the PREFIX/--prefix and LIB/--lib options to Makefile.PL/Build.PL instead of INSTALL_BASE/--install-base.
  3. You get into problems when a pure-Perl module depends on an XS module.
like image 64
ikegami Avatar answered Oct 26 '25 20:10

ikegami



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!