hardburn has asked for the wisdom of the Perl Monks concerning the following question:

This is the sort of problem where I expect something simple to be wrong . . .

I've installed the SDL library with Gentoo's packages (tried libsdl 1.2.6-r3, 1.2.7-r3, and 1.2.8-r1 (the 'r' is the Gentoo package revision number, not SDL versioning)) and have successfully compiled and run a small demo program (2DTunnel available at http://www.libsdl.org/demos.php). I've tried to install SDL_perl via Gentoo emerge and CPANPLUS.pm. In either case, when I try to load the SDL module, I get:

$ perl -MSDL -e '' Can't load '/usr/lib/perl5/vendor_perl/5.8.5/i686-linux/auto/SDL_perl/ +SDL_perl.so' for module SDL_perl: /usr/lib/perl5/vendor_perl/5.8.5/i6 +86-linux/auto/SDL_perl/SDL_perl.so: undefined symbol: filledpieColor +at /usr/lib/perl5/5.8.5/i686-linux/DynaLoader.pm line 230. at /usr/lib/perl5/vendor_perl/5.8.5/i686-linux/SDL.pm line 9 Compilation failed in require at /usr/lib/perl5/vendor_perl/5.8.5/i686 +-linux/SDL.pm line 9. BEGIN failed--compilation aborted at /usr/lib/perl5/vendor_perl/5.8.5/ +i686-linux/SDL.pm line 9. Compilation failed in require. BEGIN failed--compilation aborted.

Doing strace on the above command reveals that the SDL .so library is being loaded, so it isn't a linking problem.

This is SDL_Perl-1.20.3 on perl 5.8.5 on i686-linux. I get the same results with SDL_Perl-2.1.2.

"There is no shame in being self-taught, only in not trying to learn in the first place." -- Atrus, Myst: The Book of D'ni.

Replies are listed 'Best First'.
Re: SDL_perl Linking Problem
by zentara (Cardinal) on Mar 08, 2005 at 16:21 UTC
    With SDL you are better off getting the source tarball for libSDL and compile it yourself, then build the Perl interface yourself, so everything matches up. It's like GD, you have to have compatible versions of the libraries, and the Perl xs module, for it to work right. You have no idea how Gentoo built their version, or what patches they made have applied.

    I'm not really a human, but I play one on earth. flash japh

      Yeah, thought it would be something stupid like that. Works now. Thanks.

      "There is no shame in being self-taught, only in not trying to learn in the first place." -- Atrus, Myst: The Book of D'ni.