[IGSTK-Users] Error compiling the current cvs version on linux

Karthik Krishnan karthik.krishnan at kitware.com
Wed Jan 17 14:42:13 EST 2007


Hi Yair, Patrick,

You've compiled ITK just fine. This is a bug in
igstkToolCalibrationReader.txx .

The correct way this file should've included zlib is
   #include "itk_zlib.h"    or   #include "vtk_zlib.h"
not
   #include "zlib/zlib.h"

The problem with including "zlib/zlib.h" is that IGSTK will fail to build
1.  against installed ITK/VTK. since they don't install the zlib.h header
file in "zlib/zlib.h".
2.  if ITK and VTK were compiled so as to use system zlib.

HTH,
--
karthik

PS:
The header file itk_zlib or vtk_zlib picks the appropriate zlib library
based on whether you'd compiled ITK/VTK asking the libraries to pick the
system zlib or the zlib provided with the library.


On 1/17/07, Yair Yarom <irush at cs.huji.ac.il> wrote:
>
>
> Hi,
>
> Sorry if I was unclear:
> Under debian (etch), there is no "zlib/zlib.h" in the standard include
> paths
> (or anywhere else for that matter), as included from
> igstkToolCalibrationReader.txx. there is only /usr/include/zlib.h, so I
> changed
> the include (back?) to '#include "zlib.h"', and it compiles. I guess the
> location of zlib.h should be checked by the cmake, but I'm not sure (I'm
> new at
> this).
>
> Later on, as described earlier, there is a conflict between zlib.h and the
> ITK's zlib.h at InsightToolkit/Utilities/itkzlib/zlib.h. This is due to
> the
> fact the ITK's zlib.h is an older version (1.1.4) in comparison to the
> debian's
> version (1.2.3). The conflict is since one has an
> #ifndef _ZLIB_H
> and the other has
> #ifndef ZLIB_H
> So both are included, causing the duplicate definitions. But I guess this
> is an
> ITK bug (or me not knowing how to compile ITK).
>
>
> Regards,
>     Yair.
>
>
>
> Luis Ibanez <luis.ibanez at kitware.com> writes:
>
> > Hi Yair,
> >
> > 1) Thanks for pointing out the shift on the
> >    numbering of serial port symbols.
> >
> >    This has been entered as bug:
> >
> > http://public.kitware.com/Bug/bug.php?op=show&bugid=4314&pos=0
> >
> >    and a fix for the CMakeLists.txt file has been
> >    committed in CVS:
> >
> >
> http://public.kitware.com/cgi-bin/viewcvs.cgi/CMakeLists.txt?root=IGSTK&r1=1.23&r2=1.24
> >
> >
> >
> > 2) You seem to be using an old version of IGSTK.
> >    The Include for "zlib/zlib.h" was added to
> >    the igstkToolCallibrationReader.txx on June 7th
> >    2006.
> >
> >
> http://public.kitware.com/cgi-bin/viewcvs.cgi/Source/igstkToolCalibrationReader.txx?annotate=1.3&root=IGSTK
> >
> >
> > Please use an updated version of IGSTK.
> >
> >
> > Please let us know if you find any other problems,
> >
> >
> >
> >  Regards,
> >
> >
> >    Luis
> >
> >
> >
> > ---------------------------
> > Yair Yarom wrote:
> >> Hi,
> >> I have several compilation errors for the cvs version on linux
> (debian):
> >> 1. In the CMakeLists.txt, the "high" ports numbering is wrong (no port
> 4 and
> >> extra port 8), at around line 161, instead of:
> >>    SET(IGSTK_SERIAL_PORT_5 "/dev/ttyS4" CACHE STRING
> >>    SET(IGSTK_SERIAL_PORT_6 "/dev/ttyS5" CACHE STRING
> >>    SET(IGSTK_SERIAL_PORT_7 "/dev/ttyS6" CACHE STRING
> >>    SET(IGSTK_SERIAL_PORT_8 "/dev/ttyS7" CACHE STRING
> >> it should be (I think):
> >>    SET(IGSTK_SERIAL_PORT_4 "/dev/ttyS4" CACHE STRING
> >>    SET(IGSTK_SERIAL_PORT_5 "/dev/ttyS5" CACHE STRING
> >>    SET(IGSTK_SERIAL_PORT_6 "/dev/ttyS6" CACHE STRING
> >>    SET(IGSTK_SERIAL_PORT_7 "/dev/ttyS7" CACHE STRING
> >> 2. In igstkToolCalibrationReader.txx, there is no "zlib/zlib.h" to
> include,
> >> there is only "zlib.h". But this fix possibly causes error 3:
> >> 3. When building with testing, I get the error:
> >> [ 46%] Built target IGSTK
> >> [ 46%] Building CXX object
> Testing/CMakeFiles/igstkStateMachineExportTest.dir/igstkStateMachineExportTest.o
> >> /usr/include/zlib.h:82: error: redefinition of 'struct z_stream_s'
> >> /usr/local/include/InsightToolkit/Utilities/itkzlib/zlib.h:68: error:
> previous definition of 'struct z_stream_s'
> >> /usr/include/zlib.h:101: error: invalid type in declaration before ';'
> token
> >> /usr/include/zlib.h:101: error: conflicting declaration 'typedef int
> z_stream'
> >> /usr/local/include/InsightToolkit/Utilities/itkzlib/zlib.h:87: error:
> 'z_stream' has a previous declaration as 'typedef struct z_stream_s
> z_stream'
> >> /usr/include/zlib.h:1114: error: declaration of C function 'int
> itk_zlib_gzwrite(void*, const void*, unsigned int)' conflicts with
> >> /usr/local/include/InsightToolkit/Utilities/itkzlib/zlib.h:704: error:
> previous declaration 'int itk_zlib_gzwrite(void*, void*, unsigned int)' here
> >> /usr/include/zlib.h:1350: error: redefinition of 'struct
> internal_state'
> >> /usr/local/include/InsightToolkit/Utilities/itkzlib/zlib.h:882: error:
> previous definition of 'struct internal_state'
> >> make[2]: ***
> [Testing/CMakeFiles/igstkStateMachineExportTest.dir/igstkStateMachineExportTest.o]
> Error 1
> >> make[1]: *** [Testing/CMakeFiles/igstkStateMachineExportTest.dir/all]
> Error 2
> >> make: *** [all] Error 2
> >> Without the testings, it builds fine.
> >> Thanks,
> >>     Yair.
> >> _______________________________________________
> >> IGSTK-Users mailing list
> >> IGSTK-Users at public.kitware.com
> >> http://public.kitware.com/cgi-bin/mailman/listinfo/igstk-users
> >>
> _______________________________________________
> IGSTK-Users mailing list
> IGSTK-Users at public.kitware.com
> http://public.kitware.com/cgi-bin/mailman/listinfo/igstk-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/igstk-users/attachments/20070117/5b0cc11a/attachment-0001.html>


More information about the IGSTK-Users mailing list