Why am I getting "undefined reference" errors when compiling my XS using Perl 5.10?

I have a C ++ object that I convert to Perl using Perl XS. This process works great with Perl 5.8.5 and 5.8.7. But as soon as I try to use Perl 5.10.0, I encounter a lot of compilation errors. Most of them:

  undefined reference to 'PL_stack_max'
 undefined reference to 'PL_stack_sp'
 undefined reference to 'Perl_sv_2pv_flags'
 undefined reference to 'Perl_sv_setref_pv'

This tells me that, for some reason, Perl XS stuff is not properly linked. When I switched from 5.8.5 to v.5.8.7, I just had to change the version and do it again.

Any tips?

+6
perl perl-xs
source share
2 answers

Have you recompiled XS extensions when upgrading to 5.10.0?

Did you install Perl 5.10.0 to support backward compatibility when creating it? (Is this possible? I never tried to create backward compatibility, so I can’t be sure it’s even an option, and @Ysth thinks it is not.)

I have seen similar problems when working between major versions of Perl, but not recently enough to be sure what exactly causes the problem. But I seem to remember that somewhere near the end of the configuration process, the question arises, which previous versions of Perl should be compatible with XS extensions, etc.

+7
source share

I used 32-bit Perl 5.10.0 on a 64-bit machine. The problem is solved! Thanks to all who responded.

+2
source share

All Articles