[Insight-developers] RE: [Insight-users] Link error: DICOM

Lorensen, William E (Research) lorensen at crd.ge.com
Mon, 22 Mar 2004 10:42:29 -0500


Folks,
We have added a namespace to the DICOMParser utility in itk. The namespace
is configured by CMake and is itkdicomparser:: for itk. We have not done
anything to the vtk DICOMParser utility yet. However, this change should
correct the link symbol clashes between itk and vtk libraries.

To get the changes you will need to update Utilities/CMakeLists.txt and
Utilities/DICOMParser as well as Code/IO/itkDICOMImageIO2.cxx,
Code/IO/itkDICOMImageIO2.h and Code/itkDICOMSeriesFileNames.h.

If you have application code that uses the Utilities/DICOMParser library
directly, ,you will have to qualify the classes with itkdicomparser::.

This closes Bug#684: http://www.itk.org/Bug/bug.php?op=show&bugid=684&pos=4


Bill and Jim

-----Original Message-----
From: Corinne Mattmann [mailto:mattmaco at ee.ethz.ch]
Sent: Wednesday, March 17, 2004 12:58 PM
To: insight-users at itk.org
Subject: [Insight-users] Link error


Hi,

I use ITK and VTK. Lately, I decided to replace VTK version 4.2 with the
latest CVS version. When I recompiled all my projects, I got the link
errors attached at the end of this email. All the projects which do not
link anymore seem to have in common that they use VTK and include the
itkImageFileReader.h (see an example of the included *.h-files further
down). I use the latest CVS version of ITK (today).
Does somebody know what is wrong here?

Thanks very much,
Corinne

---------------------------------------
 
#include <iostream>
#include <sstream>

#include "itkWarpImageFilter.h"
#include "itkImageFileReader.h"
#include "itkImageToVTKImageFilter.h"
#include "itkVectorIndexSelectionCastImageFilter.h"
#include "itkRescaleIntensityImageFilter.h"
#include "itkHistogramMatchingImageFilter.h"
#include "itkFEM.h"
#include "itkFEMRegistrationFilter.h"

#include "vtkMarchingCubes.h"
#include "vtkPolyDataMapper.h"
#include "vtkRenderer.h"
#include "vtkRenderWindow.h"
#include "vtkRenderWindowInteractor.h"
#include "vtkPointData.h"
#include "vtkFloatArray.h"
#include "vtkCellArray.h"
#include "vtkPolyData.h"
#include "vtkMaskPolyData.h"
#include "vtkProperty.h"

----------------------------------------

Linking...
ITKDICOMParser.lib(DICOMParser.obj) : error LNK2005: "public: __thiscall
DICOMParser::DICOMParser(void)" (??0DICOMParser at  at QAE at XZ) already defined
in vtkDICOMParser.lib(vtkDICOMParser.dll)
ITKDICOMParser.lib(DICOMParser.obj) : error LNK2005: "public: bool
__thiscall DICOMParser::OpenFile(class std::basic_string<char,struct
std::char_traits<char>,class std::allocator<char> > const &)"
(?OpenFile at DICOMParser at  at QAE_NABV?$basic_string at DU?$
char_traits at D at std at  at V?$allocator at D at 2 at  at std at  at  at Z) already defined in
vtkDICOMParser.lib(vtkDICOMParser.dll)
ITKDICOMParser.lib(DICOMParser.obj) : error LNK2005: "public: bool
__thiscall DICOMParser::ReadHeader(void)"
(?ReadHeader at DICOMParser at  at QAE_NXZ) already defined in
vtkDICOMParser.lib(vtkDICOMParser.dll)
ITKDICOMParser.lib(DICOMParser.obj) : error LNK2005: "public: void
__thiscall DICOMParser::ClearAllDICOMTagCallbacks(void)"
(?ClearAllDICOMTagCallbacks at DICOMParser at  at QAEXXZ) already defined in
vtkDICOMParser.lib(vtkDICOMParser.dll)
ITKDICOMParser.lib(DICOMParser.obj) : warning LNK4006: "public:
__thiscall DICOMParser::DICOMParser(void)" (??0DICOMParser at  at QAE at XZ)
already defined in vtkDICOMParser.lib(vtkDICOMParser.dll); second
definition ignored
ITKDICOMParser.lib(DICOMParser.obj) : warning LNK4006: "public: bool
__thiscall DICOMParser::OpenFile(class std::basic_string<char,struct
std::char_traits<char>,class std::allocator<char> > const &)"
(?OpenFile at DICOMParser at  at QAE_NABV?$basic_string at DU
?$char_traits at D at std at  at V?$allocator at D at 2 at  at std at  at  at Z) already defined in
vtkDICOMParser.lib(vtkDICOMParser.dll); second definition ignored
ITKDICOMParser.lib(DICOMParser.obj) : warning LNK4006: "public: bool
__thiscall DICOMParser::ReadHeader(void)"
(?ReadHeader at DICOMParser at  at QAE_NXZ) already defined in
vtkDICOMParser.lib(vtkDICOMParser.dll); second definition ignored
ITKDICOMParser.lib(DICOMParser.obj) : warning LNK4006: "public: void
__thiscall DICOMParser::ClearAllDICOMTagCallbacks(void)"
(?ClearAllDICOMTagCallbacks at DICOMParser at  at QAEXXZ) already defined in
vtkDICOMParser.lib(vtkDICOMParser.dll); second definiti
on ignored
   Creating library D:\packwin\vtkMy\bin\bin\Debug/test6_Corinne.lib and
object D:\packwin\vtkMy\bin\bin\Debug/test6_Corinne.exp
D:\packwin\vtkMy\bin\bin\Debug/test6_Corinne.exe : fatal error LNK1169:
one or more multiply defined symbols found
Error executing link.exe.

_______________________________________________
Insight-users mailing list
Insight-users at itk.org
http://www.itk.org/mailman/listinfo/insight-users