---------------------------------------- > To: perl-xs@perl.org > Subject: loadable library and perl binaries are mismatched > From: esq...@sommarskog.se > Date: Wed, 13 Jul 2016 18:18:24 +0200 > > I have an XS module to permit Perl scripts access SQL Server through OLE DB. > Besides a source-code only distribution, I also maintain a binary > distribution for ActivePerl and for 5.18 and 5.20 I have also supported > Strawberry Perl. > > Up to Perl 5.16 it was easy - since ActivePerl was labeled to have been > built with Visual Studio (MSVC), I could build my module with Visual > Studio as well. > > With Perl 5.18, ActiveState switched to gcc. What I did was to build Perl > from sources with MSVC and build my module in that Perl environment. The > binary produced runs well with ActivePerl and Strawberry Perl. > > I am not trying to redo that stunt with Perl 5.22 and 5.24 and it works > for 64-bit Perl. However, for 32-bit Perl, I get this error message when > I try to invoke the module on ActivePerl or Strawberry Perl 5.22: > > SqlServer.c: loadable library and perl binaries are mismatched (got > handshake key 0B080080, needed 0AF00080) > > (The error message for 5.24 is the same, but with different handshake > keys.) >
Your XS DLL and perl core do not agree on -D options, or the config.h files used to compile both are different. Perl XS DLLs/SOs are not binary compatible with anything but the perl binary that built them. The high 16 bits of the handshake key are the size of the interp struct. Your XS module and perl core do NOT agree on where the memory offsets for various members in the interp struct are.