Why do I get "undefined reference" errors when I compile my XS with Perl 5.10?

1.6k Views Asked by At

I have a C++ object that I am converting to Perl using Perl XS. This process works fine with Perl 5.8.5 and 5.8.7. But as soon as I try to use Perl 5.10.0, I run into a lot of compile errors. Most of them are along these lines:

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'

That tells me that for some reason the Perl XS stuff isn't being linked in properly. When I went from 5.8.5 to v5.8.7, I just had to change the version and make again.

Any tips?

2

There are 2 best solutions below

4
On

Did you recompile the XS extensions when you moved to 5.10.0?

Did you set Perl 5.10.0 to maintain backwards compatibility when you built it? (Is that even possible? I've never tried to build backwards compatibility, so I can't be sure it is even an option, and @Ysth thinks it is not.)

I've seen similar problems when working between main versions of Perl, but not sufficiently recently to be confident of exactly what causes the problem. But I seem to remember that somewhere near the end of the configuration process there is a question about which previous versions of Perl to be compatible with for XS extensions, etc.

0
On

I was using 32bit Perl 5.10.0 on a 64bit machine. Problem solved! Thanks to everyone who responded.