[IGSTK-Users] Error compiling the current cvs version on linux
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
The correct way this file should've included zlib is
#include "itk_zlib.h" or #include "vtk_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.
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:
> Sorry if I was unclear:
> Under debian (etch), there is no "zlib/zlib.h" in the standard include
> (or anywhere else for that matter), as included from
> igstkToolCalibrationReader.txx. there is only /usr/include/zlib.h, so I
> 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
> 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
> fact the ITK's zlib.h is an older version (1.1.4) in comparison to the
> 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).
> 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:
> > 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.
> > 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
> >> 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
> >> 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
> >> /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 ';'
> >> /usr/include/zlib.h:101: error: conflicting declaration 'typedef int
> >> /usr/local/include/InsightToolkit/Utilities/itkzlib/zlib.h:87: error:
> 'z_stream' has a previous declaration as 'typedef struct z_stream_s
> >> /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
> >> /usr/local/include/InsightToolkit/Utilities/itkzlib/zlib.h:882: error:
> previous definition of 'struct internal_state'
> >> make: ***
> Error 1
> >> make: *** [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
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the IGSTK-Users