[SDL] undefined reference in libSDL.so

Joe MacDonald joe at deserted.net
Wed Jan 17 19:59:41 PST 2001


I have an explanation and a workaround, but not a real fix.  The
problem, as config.log says, is three unresolved symbols in libSDL:

   + Color565DitherYV12MMX1X
   + ColorRGBDitherYV12MMX1X
   + outb

I grepped around a bit and discovered that 'outb' is only used in the
framebuffer code and since I don't care about a framebuffer video mode,
I was able to 'fix' it by --disable-video-fbcon.  Okay, not a solution,
but it works for me.

The other two symbols, not surprisingly, are defined in
./src/video/SDL_yuv_mmx.c, quite clearly, and referenced in
./src/video/SDL_yuv_sw.c.  I tried fiddling with the Makefile and
building things by hand, but that only resulted in segfaults with the
tests, then I noticed something that should have been plainly obvious to
me from the start.  All of SDL_yuv_mmx.c is wrapped in the following:

#if defined(i386) && defined(__GNUC__) && defined(USE_ASMBLIT)
   .
      .
         .
#endif

But the only spots where the offending two symbols are referenced are
protected by:

#if defined(i386) && defined(__GNUC__)
   .
      .
         .
#endif

Which got me looking a lot closer at SDL_yuv_sw.c.  At first I thought
the problem was that USE_ASMBLIT was undefined in my environment and
that the '&& defined(USE_ASMBLIT)' should be added to the other #ifs,
but that still didn't fix everything.  That's when I noticed that the
'extern' references around them didn't even have the benefit of the
short 'if'.  So, I added the extended if around them as well and now all
seems not too bad.  I don't say all seems well because the latest smpeg
(anything after 0.3.5, acutally) from loki segfaults when I try to load
anything in it, audio or video, but since other SDL-based tools (only
tried mtv and SDLroids so far) seem to work fine, I'm now going to
assume it is smpeg that doesn't want to play nicely.

So, am I actually the only one with a configuration that will cause this
to happen or should there be an update to SDL_yuv_sw.c?  Or have I
managed to break something else and I've just been lucky that SDLroids
hasn't trashed my system yet?

-Joe.

In message: Re: [SDL] undefined reference in libSDL.so on 16/01/2001
(Tue 10:50) Joe MacDonald wrote:

> 
> Oops, sorry about that.  The system is a modified Slackware 7.1.  Clean
> install, migrated to 2.4.0-ac4 from a 2.2 series kernel plus all the
> required package updates (binutils, util-linux, modutils and ppp).  I'm
> using gcc-2.95.2, compiled from source, and Gnu Make 3.78.
> 
> The only other non-stock Slackware item is XFree, I've upgraded to
> 4.0.1e (I think that was the last one I checked out of CVS, from the
> trunk about a week and a half ago now) from the DRI project's CVS tree.
> I have the glide3x libraries and headers (definitely not the latest
> versions there, though) for an AGP Voodoo3 2000 card.  DRI seems to be
> running just fine with Q3A and CivCTP doesn't crash any more often than
> it used to.  UT is giving me grief, but I gather that's my own fault for
> moving to XFree 4.0, so I guess I'll live with it.
> 
> The hardware is an AMD-K6-2 450 with 168MB of RAM on a ~2gig parition
> that is almost entirely empty.  In case it's relevant my sound card is
> an authentic Creative Labs AWE 64 and it plays nicely with the OSS
> drivers and esd.
> 
> As for the configure line, that's a bit more difficult.  I'm not
> actually at my machine right now, but if I recall correctly I started
> using ./configure --prefix=/usr/local/encap/SDL-1.1.7 and failing that I
> just did a ./configure.  I didn't see anything to turn off MMX code, but
> maybe that's what I need to do.
> 
> Is there anything else you need to know?  I can't think of what else
> might be relevant.
> 
> Thanks,
> -Joe.
> 
> In message: Re: [SDL] undefined reference in libSDL.so (<E14IQQq-0002l6-00 at roboto.devolution.com>)
> on 15/01/2001 (Mon 23:21) Sam Lantinga wrote:
> 
> > 
> > > Hey all,
> > 
> > > I've been trying to install libsdl for months now, all the way back to
> > > 1.1.3 and without fail I always get exactly the same problem in my
> > > ./configure step of the libsdl test:
> > 
> > > configure:2285: gcc -o conftest -I/usr/local/gnome/include -L/usr/local/gnome/lib -I/usr/local/include -L/usr/local/lib -I/usr/X11R6/include -I/usr/local/include -I/usr/local/include/SDL -D_REENTRANT -I/usr/local/gnome/include -L/usr/local/gnome/lib -I/usr/local/include -L/usr/local/lib  conftest.c  -L/usr/local/lib -Wl,-rpath,/usr/local/lib -lSDL -lpthread 1>&5
> > > /usr/local/lib/libSDL.so: undefined reference to `Color565DitherYV12MMX1X'
> > > /usr/local/lib/libSDL.so: undefined reference to `ColorRGBDitherYV12MMX1X'
> > > /usr/local/lib/libSDL.so: undefined reference to `outb'
> > 
> > Can you tell us more about your system and compiler version?
> > What options are you using when building SDL?
> > 
> > Thanks,
> > 	-Sam Lantinga, Lead Programmer, Loki Entertainment Software
> 

-- 
-Joe MacDonald.
------------------------------------------------------------------------
X windows:
	You'll wish we were kidding.



More information about the SDL mailing list