[MPlayer-cygwin] Compiling MPlayer with mp3lame support on MinGW

Goran Katavic elc at point.hr
Wed May 5 13:28:52 CEST 2004


Hi! 

Can anyone help me with compiling MPlayer with mp3lame support on MinGW?
(Mplayer-1.0-pre3) 

I'm new in MinGW and windows compiling because I usualy use Linux. 

I compile lame 3.96 with ./configure --prefix =/mingw and make install
Aftter this i have files: 

/mingw/include/lame/lame.h 

/mingw/lib/libmp3lame.a
/mingw/lib/libmp3lame.dll.a
/mingw/lib/libmp3lame.la 


I tried test program (extracted from configure script): 

#include <lame/lame.h>
int main(void)
{
lame_version_t lv; 

(void) lame_init();
get_lame_version_numerical(&lv);
  printf("%d%d\n",lv.major,lv.minor);
return 0;
} 


First I tried (standard) dynamic linking: 

gcc lametest.c -o lametest -lmp3lame  (compiles OK)
./lametest 

Windows says: This application has failed to start because
             libmp3lame-0.dll was not found.
(Why it is not compiled and installed with lame's make install)? 


Then I tried static linking: 

gcc lametest.c -o lametest -lmp3lame -static  (compiles OK)
./lametest
396 

 

Ok, now i try to compile mplayer:
./configure --prefix=/usr --enable-runtime-cpudetection --enable-largefiles 

It didn't detect mp3lame support! 

So i decided to manualy edit configure script and changed to this: 

 # Note: libmp3lame usually depends on vorbis
 cc_check -lmp3lame $_ld_vorbis -lm && ( "$TMPO" >> "$TMPLOG" 2>&1 ) && 
_mp3lame=yes
 _mp3lame=yes
   _def_mp3lame="#define HAVE_MP3LAME 396"
   _def_cfg_mp3lame="#define CONFIG_MP3LAME 396"
   _ld_mp3lame="-lmp3lame $_ld_vorbis"
 echores "$_mp3lame" 

After this configure script detected mp3lame support. 

make (compiles OK - after i modified vd_lcl.c for Z_?_COMPRESS
     and changed index to strchr in libmpdemux/cookies.c) 

./mplayer.exe returns (again):
This application has failed to start because libmp3lame-0.dll was not found. 


Second try (static cpompile):
./configure --prefix=/usr --enable-runtime-cpudetection --enable-largefiles 
 --enable static 

At the end (when linking mplayer.exe) happens this:
gcc -O4 -march=i486 -mcpu=i686 -pipe -ffast-math -fomit-frame-pointer 
 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64  -Ilibmpdemux -Iloader -Ilibvo    
 -o mplayer mplayer.o mp_msg.o cpudetect.o codec-cfg.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    libmpcodecs/libmpcodecs.a 
mp3lib/libMP3.a liba52/liba52.a libmpeg2/libmpeg2.a loader/driver.o 
loader/vfl.o loader/afl.o loader/dshow/libDS_Filter.a 
loader/dmo/libDMO_Filter.a libaf/libaf.a libmpdemux/libmpdemux.a 
input/libinput.a postproc/libswscale.a osdep/libosdep.a -Llibmpdvdkit2 
 -lmpdvdkit libavcodec/libavcodec.a       -lmp3lame    -static          
 -lws2_32  -lgdi32 -lwinmm  -ladvapi32 -lole32     -Llibmpflac -lmpflac  
libfaad2/libfaad2.a  -static   -lopengl32 -lgdi32        -lws2_32            
 -static -rdynamic   -lm
/mingw/lib\libmp3lame.a(common.o)(.data+0x0):common.c: multiple definition 
of `pcm_point'
mp3lib/libMP3.a(sr1.o)(.bss+0x28):sr1.c: first defined here
/mingw/lib\libmp3lame.a(layer3.o)(.text+0x1d48):layer3.c: multiple 
definition of `init_layer3'
mp3lib/libMP3.a(sr1.o)(.text+0x1b0):sr1.c: first defined here
/mingw/lib\libmp3lame.a(layer3.o)(.text+0x17a0):layer3.c: multiple 
definition of `bandInfo'
mp3lib/libMP3.a(sr1.o)(.data+0x33c0):sr1.c: first defined here
/mingw/lib\libmp3lame.a(layer2.o)(.text+0x0):layer2.c: multiple definition 
of `alloc_0'
mp3lib/libMP3.a(sr1.o)(.data+0x1da0):sr1.c: first defined here
/mingw/lib\libmp3lame.a(layer2.o)(.text+0x480):layer2.c: multiple definition 
of `alloc_1'
mp3lib/libMP3.a(sr1.o)(.data+0x2220):sr1.c: first defined here
/mingw/lib\libmp3lame.a(layer2.o)(.text+0x940):layer2.c: multiple definition 
of `alloc_2'
mp3lib/libMP3.a(sr1.o)(.data+0x26e0):sr1.c: first defined here
/mingw/lib\libmp3lame.a(layer2.o)(.text+0xa80):layer2.c: multiple definition 
of `alloc_3'
mp3lib/libMP3.a(sr1.o)(.data+0x2820):sr1.c: first defined here
/mingw/lib\libmp3lame.a(layer2.o)(.text+0xc40):layer2.c: multiple definition 
of `alloc_4'
mp3lib/libMP3.a(sr1.o)(.data+0x29e0):sr1.c: first defined here
/mingw/lib\libmp3lame.a(tabinit.o)(.text+0x1008):tabinit.c: multiple 
definition of `make_decode_tables'
mp3lib/libMP3.a(sr1.o)(.text+0x0):sr1.c: first defined here
/mingw/lib\libmp3lame.a(tabinit.o)(.data+0x0):tabinit.c: multiple definition 
of `pnts'
mp3lib/libMP3.a(sr1.o)(.data+0x1798):sr1.c: first defined here
gcc: unrecognized option `-rdynamic'
c:\mingw\bin\make: *** [mplayer] Error 1 

It seemts that libmp3lame.a conflicts with MPlayer's libMP3.a.
So i decided to manualy edit conflicted variables in libMP3 and change them
to mp_variable_name. 

After this mplayer.exe compiled OK and everything works normal. 

But obviously - this is not a way to compile MPlayer, so I'm asking for help
how to compile it without those "ugly" modifications. 

Thanks for any help! 

 --
Goran Katavic
elc at point.hr 





More information about the MPlayer-cygwin mailing list