tags:

views:

141

answers:

2

Hi 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?

+6  A: 

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.

Jonathan Leffler
perl 5.10.0 can't be made binary-backwards compatible with 5.8.x.
ysth
@Ysth: if you say so. I remember seeing the config question, but I don't recall whether those questions came with 5.10.0. I've only built Perl 5.10.0 a couple of times this year, and wasn't paying much attention to the answers because I've never sought backwards compatibility and the default is 'No'.
Jonathan Leffler
but in this case i'm trying to recompile with 5.10.0; not use something compiled with 5.8.5 with 5.10.0
shergill
Not sure - I'd suspect path problems, perhaps. The symptom is of a mix of Perl versions. Somewhere along the line, something is picking up the wrong header, or something similar.
Jonathan Leffler
A: 

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

shergill