Incompatible libpng version in application and library

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Incompatible libpng version in application and library

KarlBlau
Hi,

I am using VTK-4.2 and QT4.
When I try to create a *.png image file I get the following error:

  libpng warning: Application was compiled with png.h from libpng-1.0.12
  libpng warning: Application  is  running with png.c from libpng-1.2.8
  libpng error: Incompatible libpng version in application and library
  ERROR: In /home/martin/local/src/vtk/vtk-4.2/IO/vtkPNGWriter.cxx, line 156
  vtkPNGWriter (0x82953c8): Unable to write PNG file!

It seems as if VTK-4.2 comes with libpng-1.0.12 by default on my system I use libpng-1.2.8.
I tried to disable the use of libpng-1.0.12 when I configured VTK. I did the following:

I did the following:

changed to CMake advanced mode

  VTK_USE_RENDERING    ON

  PNG-LIBRARY          /usr/lib/libpng.so    (-> libpng.so.3 -> libpng.so.3.1.2.8)
  PNG_PNG_INCLUDE_DIR  /usr/include          (this contains a file png.h version 3.1.2.8)


To me this seems ok.


After make and make install I see that the file png.h is no more in the ./includes/vtk directory.
Also libvtkpng.so is no more in ./lib/vtk directory. So far this seems ok.

But somehow this didn't help! I still get the same error. Even after a make clean and make distclean
and make my program. I can't understand why...


Any idea?

Thanks, MB

_______________________________________________
This is the private VTK discussion list.
Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
Follow this link to subscribe/unsubscribe:
http://www.vtk.org/mailman/listinfo/vtkusers
Reply | Threaded
Open this post in threaded view
|

Re: Incompatible libpng version in application and library

Clinton Stimpson

>From: Martin Baumann <[hidden email]>
>Subject: [vtkusers] Incompatible libpng version in application and
> library
>To: [hidden email]
>
>Hi,
>
>I am using VTK-4.2 and QT4.
>When I try to create a *.png image file I get the following error:
>
>   libpng warning: Application was compiled with png.h from libpng-1.0.12
>   libpng warning: Application  is  running with png.c from libpng-1.2.8
>   libpng error: Incompatible libpng version in application and library
>   ERROR: In /home/martin/local/src/vtk/vtk-4.2/IO/vtkPNGWriter.cxx,
>line 156
>   vtkPNGWriter (0x8295418): Unable to write PNG file!
>
>It seems as if VTK-4.2 comes with libpng-1.0.12 and QT4 comes with
>libpng-1.2.8.
>  
>
If you have a system png, Qt defaults to using it.  VTK defaults to
using its own.  I've seen both Qt and VTK break because of that.

>I tried to disable the use of libpng-1.0.12 when I configured VTK. I did
>the following:
>
>cmake
>-> toggle to advanced mode
>-> VTK_USE_SYSTEM_PNG               ON
>
>(I left the following with its standard values:)
>-> PNG_LIBRARY                          /usr/lib/libpng.so
>-> PNG_PNG_INCLUDE_DIR       /usr/include
>
>
>But this didn't help!
>
>How can I find what libpng versions are a certain png.h or png.cpp or
>libpng.so?
>I am not sure what I have to set for PNG_LIBRARY and PNG_PNG_INCLUDE_DIR
>because I
>don't know where I find the 1.2.8 versions of the files.
>I have three or four png.h png.cpp and libpngX.so
>
>
>Thanks, MB
>
>  
>
How about using VTK 5?  VTK uses its own mangled png library.  With that
version, all you have to worry about is freetype conflicts.  With VTK
4.2, you have to worry about zlib, png, tiff and freetype conflicts
(more ??).

To build VTK, I sometimes use a CMake initial cache file which parses
one of Qt's .prl files to check freetype.  If it is using the system
freetype, force VTK to use the system freetype, otherwise Qt isn't using
freetype, and VTK can use its own.

There's one catch I've seen with VTK 5 -- if you are building binaries
to distribute, VTK relies on a couple freetype functions that changed
between minor freetype releases (it seems the freetype developers broke
the rules).  You end up with your binaries not working on some
customer's machines.  I just comment out the section of VTK code in that
case, since only one class in all of VTK uses that binary incompatible
freetype function.  Qt still works because it doesn't call those functions.

VTK 5.0 made some improvements for compatiblity when using Qt, there's
still a little bit left.

Clint

_______________________________________________
This is the private VTK discussion list.
Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
Follow this link to subscribe/unsubscribe:
http://www.vtk.org/mailman/listinfo/vtkusers