Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

perl

perl-xs

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?

like image 843
shergill Avatar asked Aug 07 '09 22:08

shergill


2 Answers

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

like image 31
shergill Avatar answered Nov 15 '22 11:11

shergill


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.

like image 70
Jonathan Leffler Avatar answered Nov 15 '22 10:11

Jonathan Leffler