title: libpng warning: Incompatible libpng version in application and library
body: <p>I have an application which depends on a plethora of libraries (don't we all). Most of these libraries are installed via the package manager. For the ones which are not, I have re-compiled them but I still get the same libpng incompatibility error.</p>
  
  <pre><code>libpng warning: Application was compiled with png.h from libpng-1.2.44
  libpng warning: Application  is  running with png.c from libpng-1.4.3
  </code></pre>
  
  <p>It is an error because the resulting buffer is empty. How do I know which library is linking to the new one and which library is linking to the old one?</p>
  
  <pre><code>ldd &lt;executable-name&gt;
  
  ...
  libpng12.so.0 =&gt; /lib/x86_64-linux-gnu/libpng12.so.0 (0x00007f5a0660f000)
  ...
  </code></pre>
  
  <p>Running <code>locate png.h</code> gives me a couple of system-level files</p>
  
  <pre><code>/usr/include/png.h
  /usr/include/libpng12/png.h
  </code></pre>
  
  <p>All of which are 1.2.44.</p>
  
  <p>I am running Ubuntu 11.04 x86-64.</p>
  
  <p>UPDATE: Turns out OpenCV ships with their own version of libpng which is 1.4.3</p>