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

2

6

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?

Chantey answered 7/8, 2009 at 22:11 Comment(0)
G
7

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.

Gurgle answered 7/8, 2009 at 22:42 Comment(4)
perl 5.10.0 can't be made binary-backwards compatible with 5.8.x.Open
@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'.Gurgle
but in this case i'm trying to recompile with 5.10.0; not use something compiled with 5.8.5 with 5.10.0Chantey
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.Gurgle
C
2

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

Chantey answered 14/8, 2009 at 15:7 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.