[Insight-users] ITK 1.6 and VTK compilation

Sergio Andres sergio at unizar.es
Mon, 09 Feb 2004 13:28:59 +0100


 
Hi all,

I have just download the ITK 1.6 release.

I had to change some methods calls to vnl classes 
(vnl_vector<>.resize()) and  itkImage::GetSpacing, in my program.

Then, I re-compiled again and I got some warnings like these:
....
D:\sandres\SourceCode\ITK_Toolkit_Source\InsightToolkit-1.6.0\InsightToolkit-1.6.0\Code\Common\itkFixedArray.h(104) 
:
warning C4284: return type for 
'itk::FixedArray<float,2>::ConstReverseIterator::operator ->' is 'const 
float *' (ie; not a UDT or r
eference to a UDT.  Will produce errors if applied using infix notation)
        
D:\sandres\SourceCode\ITK_Toolkit_Source\InsightToolkit-1.6.0\InsightToolkit-1.6.0\Code\Common\itkVector.h(57) 
: see reference to class template instantiation 
'itk::FixedArray<float,2>' being compiled
        
D:\sandres\SourceCode\ITK_Toolkit_Source\InsightToolkit-1.6.0\InsightToolkit-1.6.0\Code\IO\itkDefaultConvertPixelTraits.h(172) 
: see reference to class template instantiation 'itk::Vector<float,2>' 
being compiled
...
C:\Win\Mvs\VC98\INCLUDE\vector(156) : warning C4018: '<' : 
signed/unsigned mismatch
...

ITK-VTK
---------------------
I got some errors when I compiled other application that did not produce 
any error before upgrading to 1.6.
This aplication uses ITK and VTK and linking errors are :
...
vtkpng.lib(png.obj) : error LNK2005: _png_pass_dsp_mask already defined 
in itkpng.lib(png.obj)
vtkpng.lib(png.obj) : error LNK2005: _png_pass_mask already defined in 
itkpng.lib(png.obj)
vtkpng.lib(png.obj) : error LNK2005: _png_pass_yinc already defined in 
itkpng.lib(png.obj)
vtkpng.lib(png.obj) : error LNK2005: _png_pass_ystart already defined in 
itkpng.lib(png.obj)
vtkpng.lib(png.obj) : error LNK2005: _png_pass_inc already defined in 
itkpng.lib(png.obj)
vtkpng.lib(png.obj) : error LNK2005: _png_pass_start already defined in 
itkpng.lib(png.obj)
...

I include in CMakeLists file ITK and VTK lib files:
...
# ITK_LIBRARIES
SET (ITK_LIBS    
        ITKBasicFilters
        ITKCommon
        ITKEXPAT
        ITKIO
)


# VTK_LIBRARIES
SET (VTK_LIBS
        vtkCommon
        vtkGraphics
        vtkFiltering
        vtkImaging
        vtkIO
        vtkRendering
)

LINK_LIBRARIES(${ITK_LIBS} ${VTK_LIBS} ${SMOLIB_LIBS})
...


I would appreciate any help ..

Sergio.