[MPlayer-dev-eng] [PATCH] Bugfix for static linking with SDL

Krister Lagerstrom krister at kmlager.com
Sat Jan 11 23:07:33 CET 2003


I'm trying to compile a statically linked MPlayer with SDL support. It
fails during the final linking. This seems to be caused by the linking
ordering.

The included patch swaps the X11 and SDL libs in Makefile, and this
fixes the problem. I used the latest CVS.

		/ Krister


Some more info:

Config files successfully generated by ./configure !

  Install prefix: /usr/local
  Data directory: /usr/local/share/mplayer
  Config direct.: /usr/local/etc/mplayer

  Byte order: Little Endian
  Optimizing for: Runtime CPU-Detection enabled

  Enabled optional drivers:
    Input: streaming tv-v4l edl tv cdda mpdvdkit2 vcd
    Codecs: qtx real xanim dshow/dmo win32 libvorbis libmad
    Audio output: alsa9 oss sdl mpegpes(file)
    Video output: xvidix sdl vesa gif89a jpeg mpegpes(file) fbdev xmga
mga dga xv x11
  Disabled optional drivers:
    Input: tv-bsdbt848 dvdnav dvdread dvdcss
    Codecs: opendivx xvid libdv libavcodec liblzo
    Audio output: sgi sun esd arts dxr2 nas win32
    Video output: bl zr dxr3 dxr2 directx png svga aa ggi opengl
directfb tdfxfb 3dfx



gcc -O4 -march=i486 -mcpu=i686 -pipe -ffast-math -fomit-frame-pointer
-D_REENTRANT -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -Ilibmpdemux
-Iloader -Ilibvo -I/usr/local/include -I/usr/local/include/freetype2
-I/usr/local/include/SDL -D_REENTRANT  -o mplayer mplayer.o mp_msg.o
cpudetect.o codec-cfg.o cfgparser.o my_profile.o spudec.o playtree.o
playtreeparser.o asxparser.o vobsub.o subreader.o sub_cc.o find_sub.o
m_config.o m_option.o parser-cfg.o m_struct.o unrarlib.o mixer.o
parser-mpcmd.o libvo/libvo.a libao2/libao2.a  vidix/libvidix.a
libmpcodecs/libmpcodecs.a mp3lib/libMP3.a liba52/liba52.a
libmpeg2/libmpeg2.a loader/libloader.a loader/dshow/libDS_Filter.a
loader/dmo/libDMO_Filter.a libaf/libaf.a libmpdemux/libmpdemux.a
input/libinput.a postproc/libpostproc.a postproc/libswscale.a
linux/libosdep.a -Llibmpdvdkit2 -lmpdvdkit   -lmad -lvorbis -logg
 -static -lz -ljpeg -lasound -ldl -lpthread  -L/usr/local/lib
-lfreetype  -lcdda_interface -lcdda_paranoia -lnsl   -static
-lXxf86dga -lXv -lXxf86vm -lXinerama -L/usr/X11R6/lib -lXext -lX11
-lnsl -lmad -lnsl -L/usr/local/lib -Wl,-rpath,/usr/local/lib -lSDL
-lpthread      -lungif        -static -lpthread -ldl -rdynamic  -lm
/usr/local/lib/libSDL.a(SDL_x11video.lo): In function `create_aux_windows':
/home/krister/proj/freevo/runtime/build/SDL-1.2.5/src/video/x11/SDL_x11video.c:315:
undefined reference to `XGetWMHints'
/home/krister/proj/freevo/runtime/build/SDL-1.2.5/src/video/x11/SDL_x11video.c:316:
undefined reference to `XGetWMName'
/home/krister/proj/freevo/runtime/build/SDL-1.2.5/src/video/x11/SDL_x11video.c:317:
undefined reference to `XGetWMIconName'
/home/krister/proj/freevo/runtime/build/SDL-1.2.5/src/video/x11/SDL_x11video.c:330:
undefined reference to `XAllocWMHints'
/home/krister/proj/freevo/runtime/build/SDL-1.2.5/src/video/x11/SDL_x11video.c:337:
undefined reference to `XSetWMName'
/home/krister/proj/freevo/runtime/build/SDL-1.2.5/src/video/x11/SDL_x11video.c:341:
undefined reference to `XSetWMIconName'
/home/krister/proj/freevo/runtime/build/SDL-1.2.5/src/video/x11/SDL_x11video.c:352:
undefined reference to `XAllocClassHint'
/home/krister/proj/freevo/runtime/build/SDL-1.2.5/src/video/x11/SDL_x11video.c:367:
undefined reference to `XSetWMProtocols'


apps/main> gcc -dumpversion
2.95.3

-------------- next part --------------
Index: Makefile
===================================================================
RCS file: /cvsroot/mplayer/main/Makefile,v
retrieving revision 1.242
diff -u -u -r1.242 Makefile
--- Makefile	11 Jan 2003 10:35:31 -0000	1.242
+++ Makefile	11 Jan 2003 22:04:52 -0000
@@ -33,7 +33,7 @@
 OBJS_MENCODER = $(SRCS_MENCODER:.c=.o)
 OBJS_MPLAYER = $(SRCS_MPLAYER:.c=.o)
 
-VO_LIBS = $(AA_LIB) $(X_LIB) $(SDL_LIB) $(GGI_LIB) $(MP1E_LIB) $(MLIB_LIB) $(SVGA_LIB) $(DIRECTFB_LIB) $(GIF_LIB) 
+VO_LIBS = $(AA_LIB) $(SDL_LIB) $(X_LIB) $(GGI_LIB) $(MP1E_LIB) $(MLIB_LIB) $(SVGA_LIB) $(DIRECTFB_LIB) $(GIF_LIB) 
 AO_LIBS = $(ARTS_LIB) $(ESD_LIB) $(NAS_LIB) $(SGIAUDIO_LIB)
 CODEC_LIBS = $(AV_LIB) $(FAME_LIB) $(MAD_LIB) $(VORBIS_LIB) $(FAAD_LIB) $(LIBLZO_LIB) $(XVID_LIB) $(DECORE_LIB) $(PNG_LIB) $(Z_LIB) $(JPEG_LIB) $(ALSA_LIB) $(XMMS_LIB)
 COMMON_LIBS = libmpcodecs/libmpcodecs.a mp3lib/libMP3.a liba52/liba52.a libmpeg2/libmpeg2.a $(W32_LIB) $(DS_LIB) libaf/libaf.a libmpdemux/libmpdemux.a input/libinput.a $(PP_LIB) postproc/libswscale.a linux/libosdep.a $(CSS_LIB) $(CODEC_LIBS) $(FREETYPE_LIB) $(TERMCAP_LIB) $(CDPARANOIA_LIB) $(STREAMING_LIB) $(WIN32_LIB)


More information about the MPlayer-dev-eng mailing list