During the compilation opencv seems to compile against the included libpng copy (version 1.2.29). During runtime usage of the png related functionality fails and produces this warning: libpng warning: Application was compiled with png.h from libpng-1.2.29 libpng warning: Application is running with png.c from libpng-1.4.5 libpng warning: Incompatible libpng version in application and library A friend of mine reproduced the same issue on his Gentoo notebook. Reproducible: Always Steps to Reproduce: 1.Install opencv with png USE flag enabled 2.Use imread on a png file Actual Results: Output: libpng warning: Application was compiled with png.h from libpng-1.2.29 libpng warning: Application is running with png.c from libpng-1.4.5 libpng warning: Incompatible libpng version in application and library The given png file could not be parsed. Expected Results: Parsing the png file.
deimos ~ # emerge --info Portage 2.1.9.42 (default/linux/amd64/10.0/desktop/kde, gcc-4.5.2, glibc-2.13-r1, 2.6.37-gentoo x86_64) ================================================================= System uname: Linux-2.6.37-gentoo-x86_64-Intel-R-_Core-TM-_i5_CPU_M_560_@_2.67GHz-with-gentoo-2.0.1 Timestamp of tree: Fri, 11 Mar 2011 08:30:01 +0000 app-shells/bash: 4.2_p7 dev-java/java-config: 2.1.11-r3 dev-lang/python: 2.6.6-r2, 2.7.1-r1, 3.1.3-r1 dev-util/cmake: 2.8.4 sys-apps/baselayout: 2.0.1-r1 sys-apps/openrc: 0.7.0 sys-apps/sandbox: 2.5 sys-devel/autoconf: 2.13, 2.68 sys-devel/automake: 1.9.6-r3, 1.10.3, 1.11.1 sys-devel/binutils: 2.21 sys-devel/gcc: 4.4.4-r2, 4.5.2 sys-devel/gcc-config: 1.4.1 sys-devel/libtool: 2.4-r1 sys-devel/make: 3.82 virtual/os-headers: 2.6.36.1 (sys-kernel/linux-headers) ACCEPT_KEYWORDS="amd64 ~amd64" ACCEPT_LICENSE="* -@EULA skype-eula AdobeFlash-10.1 googleearth" CBUILD="x86_64-pc-linux-gnu" CFLAGS="-march=core2 -O2 -pipe -fomit-frame-pointer -fno-ident -floop-interchange -floop-strip-mine -floop-block" CHOST="x86_64-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt /usr/share/themes/oxygen-gtk/gtk-2.0" CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c" CXXFLAGS="-march=core2 -O2 -pipe -fomit-frame-pointer -fno-ident -floop-interchange -floop-strip-mine -floop-block" DISTDIR="/usr/portage/distfiles" FEATURES="assume-digests binpkg-logs distlocks fixlafiles fixpackages news parallel-fetch protect-owned sandbox sfperms splitdebug strict unknown-features-warn unmerge-logs unmerge-orphans userfetch" FFLAGS="" GENTOO_MIRRORS="http://distfiles.gentoo.org" LANG="de_AT.UTF-8" LDFLAGS="-Wl,-O1 -Wl,--as-needed" LINGUAS="de en" MAKEOPTS="-j5" PKGDIR="/usr/portage/packages" PORTAGE_CONFIGROOT="/" PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/var/lib/layman/mozilla /var/lib/layman/kde /var/lib/layman/qting-edge /usr/local/portage/overlay" SYNC="rsync://rsync.gentoo.org/gentoo-portage" USE="X a52 aac acl acpi alsa amd64 attica bash-completion berkdb bluetooth branding bzip2 cairo cdr cleartype cli cmake consolekit cracklib crypt cups cxx dbus declarative dhclient dhcp dri dts dvb dvd dvdr emboss encode exif fam ffmpeg firefox flac fortran gdbm gdu gif gpm gps graphite iconv jpeg kde kontact laptop lcms libnotify libsamplerate lm_sensors lzma mad mikmod mmx mmxext mng modules mp3 mp4 mpeg mudflap multilib ncurses networkmanager nls nptl nptlonly ogg opengl openmp pam pango pcre pdf perl plasma png policykit ppds pppd python qalculate qt3support qt4 readline samba sdl semantic-desktop session social-desktop spell sse sse2 sse3 sse4 ssl ssse3 startup-notification svg sysfs taglib tcpd theora threads tiff truetype udev unicode usb vorbis x264 xcb xcomposite xml xorg xulrunner xv xvid zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="mouse keyboard evdev wacom" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="de en" PHP_TARGETS="php5-3" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="intel vesa" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account" Unset: CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
You sure it's coming from OpenCV itself? See bug 332387. I bet you have deprecated texlive installed.
Yes, I'm pretty sure its opencv itself because the following workaround eliminates the problem for me: emerge opencv Ctrl+Z after unpacking to temporary directory Replace 3rdparty/include/png.h and pngconf.h with the system files in /usr/include Continue emerge. The produced opencv library works just fine. I think (haven't checked to be honest) that the 3rdparty/include directory gets a higher priority than /usr/include even though the packaged libpng doesn't even get built if libpng is already installed (in which case opencv links to the system libpng). The fix I'd suggest would be to move 3rdparty/include further down in the include_directories list. Should be a fairly simple patch...
it should simply be `rm -rf`-ed in the src_unpack stage
Fixed in 2.2.0 in kde overlay. Will be moved to main tree soon.