[MPlayer-cygwin] MinGW compile-problem in vd_lcl.c,missingdefinition of 'Z_NO/BEST_COMPRESSION'

Stefan Gürtler Stefan.guertler at stud.tum.de
Tue Dec 16 12:18:39 CET 2003



> Stefan Gürtler writes:
>  > > Where is the definition of 'Z_NO_COMPRESSION' and
`Z_BEST_COMPRESSION' on
>  > > your systems? Is it in zlib.h, and who do I get it?
>  > >
>  > So I found out at least that much:
>  >
http://www.cs.washington.edu/homes/suciu/XMLTK/xmill/www/XMILL/html/globals.
>  > html states that both 'Z_NO_COMPRESSION' and `Z_BEST_COMPRESSION' are
>  > defined in zlib.h.
>
> Just install zlib into MinGW, this will solve your problem.

Is there an ready-to use installation-package somewhere?
I had a bit of a hard time to compile zlib-1.2.1-tar.bz2 myself, and an
unsolved error, as documentation is somewhat poor.
( I have read README, FAQ, win32/DLL_FAQ.txt and win32/Makefile.gcc from the
archive)
Was it the right way to copy win32/Makefile.gcc to the root directory, add
'LIBRARY_PATH = /mingw/lib' and 'INCLUDE_PATH = /mingw/include' manually and
then type
./configure
make -fmakefile.gcc
make test -makefile.gcc
make install -makefile.gcc
I did not get it compiled in any other way!

Stefan at J5U7R1 ~/zlib-1.2.1
$ ./configure
Checking for gcc...
Building static library libz.a version 1.2.1 with gcc.
Checking for unistd.h... Yes.
Checking whether to use vs[n]printf() or s[n]printf()... using vs[n]printf()
Checking for vsnprintf() in stdio.h... Yes.
Checking for return value of vsnprintf()... Yes.
Checking for errno.h... Yes.
Checking for mmap support... No.

Stefan at J5U7R1 ~/zlib-1.2.1
$ make -fmakefile.gcc
gcc  -O3 -Wall -c -o adler32.o adler32.c
gcc  -O3 -Wall -c -o compress.o compress.c
gcc  -O3 -Wall -c -o crc32.o crc32.c
gcc  -O3 -Wall -c -o deflate.o deflate.c
gcc  -O3 -Wall -c -o gzio.o gzio.c
gcc  -O3 -Wall -c -o infback.o infback.c
gcc  -O3 -Wall -c -o inffast.o inffast.c
gcc  -O3 -Wall -c -o inflate.o inflate.c
gcc  -O3 -Wall -c -o inftrees.o inftrees.c
gcc  -O3 -Wall -c -o trees.o trees.c
gcc  -O3 -Wall -c -o uncompr.o uncompr.c
gcc  -O3 -Wall -c -o zutil.o zutil.c
ar rcs libz.a adler32.o compress.o crc32.o deflate.o gzio.o infback.o inffas
t.o inflate.o inftrees.o trees.o uncompr.o zutil.o
windres --define GCC_WINDRES -o zlibrc.o win32/zlib1.rc
dllwrap --driver-name gcc --def win32/zlib.def \
  --implib libzdll.a -o zlib1.dll adler32.o compress.o crc32.o deflate.o
gzio.o infback.o inffast.o inflate.o inftrees.o trees.o uncompr.o zutil.o
zlibrc.o
strip zlib1.dll
gcc  -O3 -Wall -c -o example.o example.c
gcc  -s -o example example.o libz.a
gcc  -O3 -Wall -c -o minigzip.o minigzip.c
gcc  -s -o minigzip minigzip.o libz.a
gcc  -s -o example_d example.o libzdll.a
gcc  -s -o minigzip_d minigzip.o libzdll.a

Stefan at J5U7R1 ~/zlib-1.2.1
$ make test -fmakefile.gcc
./example
zlib version 1.2.1 = 0x1210, compile flags = 0x55
uncompress(): hello, hello!
gzread(): hello, hello!
gzgets() after gzseek:  hello!
inflate(): hello, hello!
large_inflate(): OK
after inflateSync(): hello, hello!
inflate with dictionary: hello, hello!
echo hello world | ./minigzip | ./minigzip -d
hello world

Stefan at J5U7R1 ~/zlib-1.2.1
$ make install -fmakefile.gcc
/bin/sh.exe: -c: line 2: syntax error: unexpected end of file    <- ?
make: [install] Error 2 (ignored)
/bin/sh.exe: -c: line 2: syntax error: unexpected end of file    <- ?
make: [install] Error 2 (ignored)
cp -fp zlib.h /mingw/include
cp -fp zconf.h /mingw/include
cp -fp libz.a /mingw/lib
cp -fp libzdll.a /mingw/lib

Any idea what is going on? make test does not give any errors, but when
running make install i get an error from sh.exe (!)

>
>  > But as HAVE_ZLIB is undefind in config.h and therefore zlib.h is not
>  > included in vd_lcl.c, I get the compile-error. HAVE_ZLIB is undefined
>  > rightly, as i do not have zlib installed on my mingw-system. This looks
like
>  > an Bug to me, using an filemember that is not defined in every case.
But my
>  > knowlege is not good enough to summit a path myself. Another of those
>  > #ifdefine HAVE_ZLIB constructions ?!?
>  > I added the two definitions manually to vd_lcl.c and try to compile
again.
>  >
>  > ...
>  > #ifdef HAVE_ZLIB
>  > #include <zlib.h>
>  > #endif
>  >
>  > +#define Z_NO_COMPRESSION         0
>  > +#define Z_BEST_COMPRESSION       9
>  >
>  > #include "mp_msg.h"
>  > ...

After adding those two definitions manually (and besore compiling zlib
myself) mplayer could be compiled ucessfully again. Up to now i did not
encounter any crashes during runtime. Though I do not know for what sort of
files the compression is used and therefore could not test compression.
mplayer might crash on that.

>
> Sascha Sommer committed a fix for this.  Update to latest CVS and try
> again.  Please report your success or failure here.
>
Right away:
This is done without zlib being installed yet!
Downloaded latest cvs into new directory and added libavcodec from 13.12.03.
./configure --prefix=/opt/mplayer-031216
 ...
Config files successfully generated by ./configure !

  Install prefix: /optmplayer-031216
  Data directory: /optmplayer-031216/share/mplayer
  Config direct.: /optmplayer-031216/etc/mplayer

  Byte order: Little Endian
  Optimizing for: pentium3 mmx mmx2 sse mtrr

  Languages:
    Messages/GUI: en
    Manual pages: en (no localization selected, use --language=all)

  Enabled optional drivers:
    Input: ftp network edl tv mpdvdkit2
    Codecs: flac(internal) libavcodec faad2(internal) libvorbis
    Audio output: win32 mpegpes(file)
    Video output: directx mpegpes(file) opengl tga
  Disabled optional drivers:
    Input: tv-v4l2 tv-v4l tv-bsdbt848 live.com matroska cdda dvdread vcd smb
    Codecs: qtx opendivx xvid libdv real xanim dshow/dmo win32 libtheora
libmad liblzo gif
    Audio output: sgi sun alsa esd arts oss dxr2 nas sdl macosx
    Video output: xvidix winvidix cvidix bl zr zr2 dxr3 dxr2 sdl vesa gif89a
jpeg png fbdev svga aa ggi xmga mga dga xvmc xv x11 directfb tdfx_vid tdfxfb
3dfx
...

make && make install

All OK, only that stupid error message concerning the mencoder-manpage
again.
I will edit the Makefile again and comment the commands that try to link
mencoder-manpages to the mplayer-manpages. Somebody seams to be pleased to
add this problematic lines to the Makefile over and over again :)
(At least i encountered this problem, its disappearance and re-appearance
regularely since pre0.9)

Stefan at J5U7R1 ~/main
$ make install
if test ! -d /optmplayer-031216/bin ; then mkdir -p /optmplayer-031216/bin ;
fi
install -m 755 -s mplayer /optmplayer-031216/bin/mplayer
if test ! -d /optmplayer-031216/man/man1 ; then mkdir -p
/optmplayer-031216/man/man1; fi
for i in en; do \
        if test "$i" = en ; then \
                install -c -m 644 DOCS/man/en/mplayer.1
/optmplayer-031216/man/man1/mplayer.1 ; \
        else \
                mkdir -p /optmplayer-031216/man/$i/man1 ; \
                install -c -m 644 DOCS/man/$i/mplayer.1
/optmplayer-031216/man/$i/man1/mplayer.1 ; \
        fi ; \
done
install -m 755 -s mencoder /optmplayer-031216/bin/mencoder
for i in en; do \
        if test "$i" = en ; then \
                ln -sf mplayer.1 /optmplayer-031216/man/man1/mencoder.1 ; \
        else \
                ln -sf mplayer.1 /optmplayer-031216/man/$i/man1/mencoder.1 ;
\
        fi ; \
done
ln: creating symbolic link `/optmplayer-031216/man/man1/mencoder.1' to
`mplayer.1': No such file or directory
make: *** [install] Error 1



Yous
Stefan



More information about the MPlayer-cygwin mailing list