[MPlayer-dev-eng] include dirs ordering: build errors related to #include <png.h>
Stanislav Maslovski
stanislav.maslovski at gmail.com
Mon Jul 16 17:47:36 CEST 2007
Hello,
When I was trying to complile mplayer from SVN today I got this build error:
================================ 8< ====================================
cc -I../libavcodec -I../libavformat -Wdisabled-optimization -Wno-pointer-sign
-Wdeclaration-after-statement -I. -I.. -I../libavutil -Wall -Wno-switch -Wpointer-arith
-Wredundant-decls -O4 -march=athlon-xp -mtune=athlon-xp -pipe -ffast-math
-fomit-frame-pointer -D_REENTRANT -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
-D_LARGEFILE64_SOURCE -I/usr/include/directfb -I/usr/include -I/usr/include/SDL
-D_REENTRANT -I/usr/include/freetype2 -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include
-I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/glib-2.0
-I/usr/lib/glib-2.0/include -I/usr/include/freetype2 -I/usr/include/libpng12 -c -o
vd_mpng.o vd_mpng.c
vd_mpng.c:57: error: expected ')' before 'pngstr'
vd_mpng.c: In function 'decode':
vd_mpng.c:67: error: 'png_structp' undeclared (first use in this function)
vd_mpng.c:67: error: (Each undeclared identifier is reported only once
vd_mpng.c:67: error: for each function it appears in.)
vd_mpng.c:67: error: expected ';' before 'png'
vd_mpng.c:68: error: 'png_infop' undeclared (first use in this function)
vd_mpng.c:68: error: expected ';' before 'info'
vd_mpng.c:69: error: expected ';' before 'endinfo'
vd_mpng.c:71: error: 'png_bytep' undeclared (first use in this function)
vd_mpng.c:71: error: 'row_p' undeclared (first use in this function)
vd_mpng.c:72: error: 'png_uint_32' undeclared (first use in this function)
vd_mpng.c:72: error: expected ';' before 'png_width'
vd_mpng.c:73: warning: ISO C90 forbids mixed declarations and code
vd_mpng.c:74: error: expected ';' before 'i'
vd_mpng.c:75: warning: ISO C90 forbids mixed declarations and code
vd_mpng.c:78: error: 'png_colorp' undeclared (first use in this function)
vd_mpng.c:78: error: expected ';' before 'pal'
vd_mpng.c:79: warning: ISO C90 forbids mixed declarations and code
vd_mpng.c:83: error: 'png' undeclared (first use in this function)
vd_mpng.c:83: warning: implicit declaration of function 'png_create_read_struct'
vd_mpng.c:83: error: 'PNG_LIBPNG_VER_STRING' undeclared (first use in this function)
vd_mpng.c:84: warning: implicit declaration of function 'png_create_info_struct'
vd_mpng.c:84: error: incompatible types in assignment
vd_mpng.c:85: error: 'endinfo' undeclared (first use in this function)
vd_mpng.c:89: warning: implicit declaration of function 'png_set_read_fn'
vd_mpng.c:89: error: 'pngReadFN' undeclared (first use in this function)
vd_mpng.c:90: warning: implicit declaration of function 'png_set_strip_16'
vd_mpng.c:91: warning: implicit declaration of function 'png_set_sig_bytes'
vd_mpng.c:92: warning: implicit declaration of function 'png_read_info'
vd_mpng.c:93: warning: implicit declaration of function 'png_get_IHDR'
vd_mpng.c:93: error: 'png_width' undeclared (first use in this function)
vd_mpng.c:93: error: 'png_height' undeclared (first use in this function)
vd_mpng.c:94: warning: implicit declaration of function 'png_set_bgr'
vd_mpng.c:96: error: invalid type argument of '->'
vd_mpng.c:113: error: invalid type argument of '->'
vd_mpng.c:141: error: 'i' undeclared (first use in this function)
vd_mpng.c:142: warning: implicit declaration of function 'png_read_image'
vd_mpng.c:146: warning: implicit declaration of function 'png_get_PLTE'
vd_mpng.c:146: error: 'pal' undeclared (first use in this function)
vd_mpng.c:157: warning: implicit declaration of function 'png_read_end'
vd_mpng.c:158: warning: implicit declaration of function 'png_destroy_read_struct'
make[2]: *** [vd_mpng.o] Error 1
make[2]: Leaving directory `/home/stas/src/svn/mplayer/libmpcodecs'
make[1]: *** [libmpcodecs/libmpcodecs.a] Error 2
make[1]: Leaving directory `/home/stas/src/svn/mplayer'
make: *** [build-stamp] Error 2
================================ >8 ======================================
This happens because there is a png.h file in ../libavcodec which is listed first.
I used the attached patch to solve this.
--
Stanislav
-------------- next part --------------
A non-text attachment was scrubbed...
Name: libpng_include_patch.diff
Type: text/x-diff
Size: 696 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20070716/81f3c289/attachment.diff>
More information about the MPlayer-dev-eng
mailing list