[MPlayer-dev-eng] liba52 conflict

Steven M. Schultz sms at 2BSD.COM
Tue Jun 18 08:35:26 CEST 2002


Hi!

	Time for a formal bugreport - I hope I've jumped thru all the
	necessary hoops ;)

	I stumbled across a conflict between MPlayer's liba52 and the
	version (0.7.3) installed on the system.   The stable/released
	liba52 is installed for building other apps.

gcc -O4 -march=i686 -mcpu=i686 -pipe -ffast-math -fomit-frame-pointer -D_THREAD_SAFE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -Ilibmpdemux -Iloader -Ilibvo -I/usr/local/include/dvdnav -I-I/usr/local/include -I/usr/local/include/dvdnav -g -O2 -I/usr/local/include -L/usr/local/lib -D_THREAD_SAFE   -o mplayer mplayer.o mp_msg.o xacodec.o cpudetect.o codec-cfg.o cfgparser.o my_profile.o spudec.o playtree.o playtreeparser.o asxparser.o vobsub.o subreader.o find_sub.o lirc_mp.o mixer.o mp-opt-reg.o -Llibvo -lvo  -Llibmpcodecs -lmpcodecs -Lmp3lib -lMP3 -Lliba52 -la52 -Llibmpeg2 -lmpeg2 -Llibavcodec -lavcodec  -Llibmpdemux -lmpdemux  -Linput -linput       -lmad -lvorbis -logg -lfaad  -Llibmpdvdkit -lmpdvdkit -L/usr/local/lib -ldvdnav -ldvdread -ldl -rdynamic -ldvd -liconv -Lpostproc -lpostproc -lxvidcore -Llinux -losdep -ltermcap   -lz  -lpng -lz -ljpeg   -lm  -Llibao2 -lao2 -L/usr/X11R6/lib -lX11 -lXext  -lGL -lXxf86dga -lXv -lXxf86vm -lXinerama -lmad     -L/usr/local/lib -Wl,-rp!
ath,/usr/local/lib -lSDL -lm -L/us
r/contrib/lib -lesd -laudiofile -lm -L/usr/X11R6/lib -lX11 -lXext -ldl     -Lvidix -lvidix     
libmpcodecs/libmpcodecs.a(ad_a52.o): In function `a52_fillbuff':
/usr/local/src/MPlayer-cvs/libmpcodecs/ad_a52.c:61: undefined reference to `crc16_block'
libmpcodecs/libmpcodecs.a(ad_a52.o): In function `init':
/usr/local/src/MPlayer-cvs/libmpcodecs/ad_a52.c:146: undefined reference to `a52_resample_init'
libmpcodecs/libmpcodecs.a(ad_a52.o): In function `decode_audio':
/usr/local/src/MPlayer-cvs/libmpcodecs/ad_a52.c:189: undefined reference to `a52_resample'
gmake: *** [mplayer] Error 1

	This is because '/usr/local/lib' has been specified very early in
	the link command.   All that the "-Lliba52" option does is add 
	an additional  directory to search.  The search ends when liba52.a
	is found.

	When the linker starts searching for '-la52' it will look _first_
	in /usr/local/lib and (possibly) find the wrong version.

	I think that in order to _always_ select the builtin/included version
	of libraries they need to be referenced as 'liba52/liba52.a' rather
	than "-Lliba52 -la52".   Otherwise there is a risk of colliding with
	older/different versions that may be installed on the system.  
	
	Actually that might not be a bad idea for _any_ library that
	MPlayer includes a local copy of - it sure would be an easy
	way to avoid conflicts in the future.

	Here's what I changed in the top level Makefile to get a build done:

--- Makefile.dist	Fri Jun 14 08:46:35 2002
+++ Makefile	Sun Jun 16 21:51:20 2002
@@ -50,7 +50,7 @@
 AO_LIBS = -Llibao2 -lao2
 A_LIBS = $(ALSA_LIB) $(ARTS_LIB) $(NAS_LIB) $(MAD_LIB) $(VORBIS_LIB) $(FAAD_LIB) $(SGIAUDIO_LIB)
 
-CODEC_LIBS = -Llibmpcodecs -lmpcodecs -Lmp3lib -lMP3 -Lliba52 -la52 -Llibmpeg2 -lmpeg2 $(AV_LIB) $(FAME_LIB)
+CODEC_LIBS = -Llibmpcodecs -lmpcodecs -Lmp3lib -lMP3 liba52/liba52.a  -Llibmpeg2 -lmpeg2 $(AV_LIB) $(FAME_LIB)
 COMMON_LIBS = $(CODEC_LIBS) -Llibmpdemux -lmpdemux  $(NEW_INPUT_LIB)  $(LIB_LOADER) $(A_LIBS) $(CSS_LIB) $(ARCH_LIB) -Lpostproc -lpostproc $(DECORE_LIB) -Llinux -losdep $(TERMCAP_LIB)  $(STREAMING_LIB) $(Z_LIB) $(GTK_LIBS) $(PNG_LIB) $(JPEG_LIB) $(GIF_LIB) $(CDPARANOIA_LIB) -lm
 ifeq ($(VIDIX),yes)
 MISC_LIBS += -Llibdha -ldha -Lvidix -lvidix

	Cheers,
	Steven Schultz
	sms at 2bsd.com
-------------- next part --------------
--- Makefile.dist	Fri Jun 14 08:42:59 2002
+++ Makefile	Mon Jun 17 23:18:38 2002
@@ -50,7 +50,7 @@
 AO_LIBS = -Llibao2 -lao2
 A_LIBS = $(ALSA_LIB) $(ARTS_LIB) $(NAS_LIB) $(MAD_LIB) $(VORBIS_LIB) $(FAAD_LIB) $(SGIAUDIO_LIB)
 
-CODEC_LIBS = -Llibmpcodecs -lmpcodecs -Lmp3lib -lMP3 -Lliba52 -la52 -Llibmpeg2 -lmpeg2 $(AV_LIB) $(FAME_LIB)
+CODEC_LIBS = -Llibmpcodecs -lmpcodecs -Lmp3lib -lMP3 liba52/liba52.a -Llibmpeg2 -lmpeg2 $(AV_LIB) $(FAME_LIB)
 COMMON_LIBS = $(CODEC_LIBS) -Llibmpdemux -lmpdemux  $(NEW_INPUT_LIB)  $(LIB_LOADER) $(A_LIBS) $(CSS_LIB) $(ARCH_LIB) -Lpostproc -lpostproc $(DECORE_LIB) -Llinux -losdep $(TERMCAP_LIB)  $(STREAMING_LIB) $(Z_LIB) $(GTK_LIBS) $(PNG_LIB) $(JPEG_LIB) $(GIF_LIB) $(CDPARANOIA_LIB) -lm
 ifeq ($(VIDIX),yes)
 MISC_LIBS += -Llibdha -ldha -Lvidix -lvidix


More information about the MPlayer-dev-eng mailing list