[Insight-users] Building ITK on a Linux box

Mathieu Malaterre malat at free . fr
Mon, 02 Sep 2002 00:22:08 +0200


Hi dear ITK gurus,
  I am stuck trying to build ITK on my Linux box: Mandrake Cooker 
(06062002). To be more precise I want to try SegmentationEditor.
  I tried first with gcc3

$gcc --version
gcc (GCC) 3.1.1 (Mandrake Linux 8.3 3.1.1-0.2mdk)

But I ge this error message:
c++  -rdynamic -shared -g -O2 -ftemplate-depth-50 -o      
/home/mmalat/Stage2002/InsightBin3/Lib/libITKIO.so      itkWriter.o 
itkImageIOBase.o itkImageIOFactory.o itkMetaImageIOFactory.o 
itkMetaImageIO.o itkPNGImageIOFactory.o itkPNGImageIO.o 
itkVOLImageIOFactory.o itkVOLImageIO.o itkVTKImageIOFactory.o 
itkVTKImageIO.o itkDicomImageIOFactory.o itkDicomImageIO.o  
-L/home/mmalat/Stage2002/InsightBin3/Lib 
-L/home/mmalat/Stage2002/VTKBin3/Lib -L/usr/X11R6/lib -lpthread -ldl 
-lpthread -ldl -lm -lGL -lXt  -lSM -lICE  -L/usr/X11R6/lib -lX11 -lXext  
-lm -lITKCommon -litkpng -litkzlib -lMetaIO -lVXLNumerics -lGL -lpthread 
-lm -ldl -lXt  -lSM -lICE  -L/usr/X11R6/lib -lX11 -lXext  
-Wl,-rpath,/home/mmalat/Stage2002/InsightBin3/Lib:/home/mmalat/Stage2002/VTKBin3/Lib:/usr/X11R6/lib
itkVTKImageIO.o: In function `std::basic_string<char, 
std::char_traits<char>, std::allocator<char> >::assign(char const*, 
unsigned)':
/usr/include/g++-v31/bits/basic_string.h:494: multiple definition of 
`std::basic_string<char, std::char_traits<char>, std::allocator<char> 
 >::assign(char const*, unsigned)'
itkPNGImageIO.o:/usr/include/g++-v31/bits/basic_string.h:494: first 
defined here
collect2: ld returned 1 exit status
make[1]: *** [/home/mmalat/Stage2002/InsightBin3/Lib/libITKIO.so] Erreur 1
make: *** [default_target] Erreur 2

(I was able to built only: libITKBasicFilters.so
libITKCommon.so
libITKNumerics.so
 libitkpng.so
libITKStatistics.so
libitkzlib.so
libMetaIO.so
libVXLNumerics.so)

Then I tried  to compile it with gcc2.95.3
And it works fine. I can build ITK against VTK. But when I change
VTKITK_WRAP_TCL = ON
I get this error:
/usr/local/bin/g++  -rdynamic -shared -g -O2 -ftemplate-depth-50 -o      
/home/mmalat/Stage2002/InsightBin/Lib/libvtkWSTCommonTCL.so      
vtkWSTCommonTCLInit.o vtkBinaryVolumeTcl.o vtkBinaryVolumeLogicTcl.o 
vtkBoundingBoxTcl.o vtkPatchedImageReaderTcl.o 
vtkPatchedLookupTableTcl.o vtkWSBoundingBoxManagerTcl.o 
vtkWSLookupTableManagerTcl.o vtkBinaryVolumeTcl.o 
vtkBinaryVolumeLogicTcl.o vtkBoundingBoxTcl.o vtkPatchedImageReaderTcl.o 
vtkPatchedLookupTableTcl.o vtkWSBoundingBoxManagerTcl.o 
vtkWSLookupTableManagerTcl.o vtkITKWatershedFilterAndWriterTcl.o  
-L/home/mmalat/Stage2002/InsightBin/Lib 
-L/home/mmalat/Stage2002/VTKBin/Lib 
-L/home/mmalat/Stage2002/InsightBin/Examples/Examples/SegmentationEditor/Common 
-L/home/mmalat/Stage2002/InsightBin/Examples/Examples/vtkITK/Common 
-L/usr/X11R6/lib -lpthread -ldl -lpthread -ldl -lm -lGL -lXt  -lSM 
-lICE  -L/usr/X11R6/lib -lX11 -lXext  -lm -lITKAlgorithms -lVXLNumerics 
-lITKCommon -lITKBasicFilters -lm -lvtkFilteringTCL -lvtkCommonTCL -ltcl 
-lITKNumerics -lITKCommon -lVXLNumerics -lGL -lXt  -lSM -lICE  
-L/usr/X11R6/lib -lX11 -lXext  -lvtkFiltering -lvtkCommon -lpthread -lm 
-ldl 
-Wl,-rpath,/home/mmalat/Stage2002/InsightBin/Lib:/home/mmalat/Stage2002/VTKBin/Lib:/home/mmalat/Stage2002/InsightBin/Examples/Examples/SegmentationEditor/Common:/home/mmalat/Stage2002/InsightBin/Examples/Examples/vtkITK/Common:/usr/X11R6/lib
vtkBinaryVolumeTcl.o: In function `vtkBinaryVolumeNewCommand(void)':
/home/mmalat/Stage2002/InsightBin/Examples/SegmentationEditor/Common/vtkBinaryVolumeTcl.cxx:10: 
multiple definition of `vtkBinaryVolumeNewCommand(void)'
vtkBinaryVolumeTcl.o:/home/mmalat/Stage2002/InsightBin/Examples/SegmentationEditor/Common/vtkBinaryVolumeTcl.cxx:10: 
first defined here
vtkBinaryVolumeTcl.o: In function `vtkBinaryVolumeCommand(void *, 
Tcl_Interp *, int, char **)':
/home/mmalat/Stage2002/InsightBin/Examples/SegmentationEditor/Common/vtkBinaryVolumeTcl.cxx:22: 
multiple definition of `vtkBinaryVolumeCommand(void *, Tcl_Interp *, 
int, char **)'
vtkBinaryVolumeTcl.o:/home/mmalat/Stage2002/InsightBin/Examples/SegmentationEditor/Common/vtkBinaryVolumeTcl.cxx:22: 
first defined here
vtkBinaryVolumeTcl.o: In function 
`vtkBinaryVolumeCppCommand(vtkBinaryVolume *, Tcl_Interp *, int, char **)':
/home/mmalat/Stage2002/InsightBin/Examples/SegmentationEditor/Common/vtkBinaryVolumeTcl.cxx:39: 
multiple definition of `vtkBinaryVolumeCppCommand(vtkBinaryVolume *, 
Tcl_Interp *, int, char **)'
vtkBinaryVolumeTcl.o:/home/mmalat/Stage2002/InsightBin/Examples/SegmentationEditor/Common/vtkBinaryVolumeTcl.cxx:39: 
first defined here
vtkBinaryVolumeLogicTcl.o: In function 
`vector<itk::hashtable_node<pair<unsigned long const, unsigned long> > 
*, allocator<itk::hashtable_node<pair<unsigned long const, unsigned 
long> > *> >::insert(itk::hashtable_node<pair<unsigned long const, 
unsigned long> > **, unsigned int, itk::hashtable_node<pair<unsigned 
long const, unsigned long> > *const &)':
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/2.95.3/../../../../include/g++-3/stl_algobase.h(.text+0x0): 
multiple definition of `vtkBinaryVolumeLogicNewCommand(void)'
vtkBinaryVolumeLogicTcl.o(.text+0x0):/usr/local/lib/gcc-lib/i586-pc-linux-gnu/2.95.3/../../../../include/g++-3/stl_algobase.h: 
first defined here
...(I dropped the end of errors messages)

Does someone understand anything ? Please could you tell/advice me what 
to do ? Thanks a lot.


Version:
I use cmake version 1.5 (one or two days old)
vtk 4.1.1 (again one or two days old)
and itk 0.0.1 (one or two days old)

mathieu malaterre