[vtkusers] Help with VTK and zlib??

David Gobbi david.gobbi at gmail.com
Tue Aug 30 16:15:47 EDT 2011


Hi Stu,

It looks like the xcode project isn't linking libvtkzlib.a.  Don't turn on the
VTK_USE_SYSTEM_ZLIB option, it is best for VTK to build its own zlib
(which is the libvtkzip.a referred to above).

Also, if you are building x86_64, then you will have to use Cocoa.  As far
as I understand, Carbon is 32-bit only.

 - David


On Tue, Aug 30, 2011 at 2:00 PM, Stu Griffin <itzastu at gmail.com> wrote:
> G'day all,
>
> I am very new to this game so thank you in advance for your patience.
>
> I am trying to build VTK on my mac as x86_64 with carbon and then attempting
> to use the sample carbon xcode project to get my bearings.
>
> I am using CMake to build VTK 5.6 source and this step seems to be going all
> smoothly. I have a nice static library that links into the xcode project
> with the appropriate source trees and no red links that i can find. I have
> changed the build settings to target OSX10.6 and x86_64 and this seems fine.
>
> However i can only get as far as building everything successfully before it
> all falls over during the linking stage.
>
> The errors that occur at this stage are;
>
> Undefined symbols for architecture x86_64:
>  "_vtk_zlib_crc32", referenced from:
>      _vtk_png_reset_crc in libvtkpng.a(png.c.o)
>      _vtk_png_calculate_crc in libvtkpng.a(png.c.o)
>  "_vtk_zlib_inflateReset", referenced from:
>      _vtk_png_reset_zstream in libvtkpng.a(png.c.o)
>      _vtk_png_decompress_chunk in libvtkpng.a(pngrutil.c.o)
>      _vtk_png_read_finish_row in libvtkpng.a(pngrutil.c.o)
>      _ZIPPreDecode in libvtktiff.a(tif_zip.c.o)
>      _PixarLogPreDecode in libvtktiff.a(tif_pixarlog.c.o)
>  "_vtk_zlib_inflateInit_", referenced from:
>      _vtk_png_create_read_struct in libvtkpng.a(pngread.c.o)
>      _vtk_png_read_init_3 in libvtkpng.a(pngread.c.o)
>      _ZIPSetupDecode in libvtktiff.a(tif_zip.c.o)
>      _PixarLogSetupDecode in libvtktiff.a(tif_pixarlog.c.o)
>  "_vtk_zlib_inflate", referenced from:
>      _vtk_png_read_row in libvtkpng.a(pngread.c.o)
>      _vtk_png_decompress_chunk in libvtkpng.a(pngrutil.c.o)
>      _vtk_png_read_finish_row in libvtkpng.a(pngrutil.c.o)
>      _ZIPDecode in libvtktiff.a(tif_zip.c.o)
>      _PixarLogDecode in libvtktiff.a(tif_pixarlog.c.o)
>  "_vtk_zlib_inflateEnd", referenced from:
>      _vtk_png_read_destroy in libvtkpng.a(pngread.c.o)
>      _ZIPCleanup in libvtktiff.a(tif_zip.c.o)
>      _PixarLogCleanup in libvtktiff.a(tif_pixarlog.c.o)
>  "_vtk_zlib_inflateSync", referenced from:
>      _ZIPDecode in libvtktiff.a(tif_zip.c.o)
>      _PixarLogDecode in libvtktiff.a(tif_pixarlog.c.o)
>  "_vtk_zlib_deflateInit_", referenced from:
>      _ZIPSetupEncode in libvtktiff.a(tif_zip.c.o)
>      _PixarLogSetupEncode in libvtktiff.a(tif_pixarlog.c.o)
>  "_vtk_zlib_deflateReset", referenced from:
>      _ZIPPreEncode in libvtktiff.a(tif_zip.c.o)
>      _PixarLogPreEncode in libvtktiff.a(tif_pixarlog.c.o)
>  "_vtk_zlib_deflate", referenced from:
>      _ZIPEncode in libvtktiff.a(tif_zip.c.o)
>      _ZIPPostEncode in libvtktiff.a(tif_zip.c.o)
>      _PixarLogEncode in libvtktiff.a(tif_pixarlog.c.o)
>      _PixarLogPostEncode in libvtktiff.a(tif_pixarlog.c.o)
>  "_vtk_zlib_deflateEnd", referenced from:
>      _ZIPCleanup in libvtktiff.a(tif_zip.c.o)
>      _PixarLogCleanup in libvtktiff.a(tif_pixarlog.c.o)
>  "_vtk_zlib_deflateParams", referenced from:
>      _ZIPVSetField in libvtktiff.a(tif_zip.c.o)
>      _PixarLogVSetField in libvtktiff.a(tif_pixarlog.c.o)
> ld: symbol(s) not found for architecture x86_64
> collect2: ld returned 1 exit status
>
> I have tried using the VTK_Use_System_Zlib argument during the CMake process
> to no avail and am really not sure where to look next.
>
> I would really appreciate a steer in the right direction.
>
> Thank you in advance,
> Stewart Griffin



More information about the vtkusers mailing list