<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7655.8">
<TITLE>Problem with ITK and GDCM in the same program</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/plain format -->
<P><FONT SIZE=2>Hi everyone,<BR>
I have a problem: I have created the program that I attached you that use both ITK and GDCM libraries.<BR>
when i run it without the comments on this lines (49-53):<BR>
ImageIOType::Pointer dicomIO = ImageIOType::New();<BR>
ReaderType::Pointer reader = ReaderType::New();<BR>
reader->SetFileName( argv[1] );<BR>
reader->SetImageIO( dicomIO );<BR>
reader->Update();<BR>
<BR>
the output is:<BR>
<BR>
edoardo@edoardo-laptop:~/ITK/Tesi/01_Autocrop/crop/bin$ make<BR>
Scanning dependencies of target cropping<BR>
[100%] Building CXX object CMakeFiles/cropping.dir/cropping.cxx.o<BR>
Linking CXX executable cropping<BR>
/usr/local/lib/InsightToolkit/libitkgdcm.a(gdcmGlobal.o): In function `gdcm::Global::Global()':<BR>
gdcmGlobal.cxx:(.text+0x0): multiple definition of `gdcm::Global::Global()'<BR>
/usr/local/lib/libgdcmDICT.a(gdcmGlobal.cxx.o):gdcmGlobal.cxx:(.text+0x0): first defined here<BR>
/usr/local/lib/InsightToolkit/libitkgdcm.a(gdcmGlobal.o): In function `gdcm::Global::Global()':<BR>
gdcmGlobal.cxx:(.text+0x300): multiple definition of `gdcm::Global::Global()'<BR>
/usr/local/lib/libgdcmDICT.a(gdcmGlobal.cxx.o):gdcmGlobal.cxx:(.text+0x80): first defined here<BR>
/usr/local/lib/InsightToolkit/libitkgdcm.a(gdcmGlobal.o): In function `gdcm::Global::~Global()':<BR>
gdcmGlobal.cxx:(.text+0x600): multiple definition of `gdcm::Global::~Global()'<BR>
/usr/local/lib/libgdcmDICT.a(gdcmGlobal.cxx.o):gdcmGlobal.cxx:(.text+0x100): first defined here<BR>
/usr/local/lib/InsightToolkit/libitkgdcm.a(gdcmGlobal.o): In function `gdcm::Global::~Global()':<BR>
gdcmGlobal.cxx:(.text+0x694): multiple definition of `gdcm::Global::~Global()'<BR>
/usr/local/lib/libgdcmDICT.a(gdcmGlobal.cxx.o):gdcmGlobal.cxx:(.text+0x14c): first defined here<BR>
collect2: ld returned 1 exit status<BR>
make[2]: *** [cropping] Errore 1<BR>
make[1]: *** [CMakeFiles/cropping.dir/all] Errore 2<BR>
make: *** [all] Errore 2<BR>
<BR>
instead of if these lines are commented I don't have any error; but my problem is that I want to use also ITK libraries into my project.<BR>
<BR>
I attached you also my CMakeList.txt<BR>
<BR>
moreover my cmake configurations are these:<BR>
<BR>
CMAKE_AR /usr/bin/ar <BR>
CMAKE_BUILD_TYPE <BR>
CMAKE_COLOR_MAKEFILE ON <BR>
CMAKE_CXX_COMPILER /usr/bin/c++ <BR>
CMAKE_CXX_FLAGS <BR>
CMAKE_CXX_FLAGS_DEBUG -g <BR>
CMAKE_CXX_FLAGS_MINSIZEREL -Os -DNDEBUG <BR>
CMAKE_CXX_FLAGS_RELEASE -O3 -DNDEBUG <BR>
CMAKE_CXX_FLAGS_RELWITHDEBINFO -O2 -g <BR>
CMAKE_C_COMPILER /usr/bin/gcc <BR>
CMAKE_C_FLAGS <BR>
CMAKE_C_FLAGS_DEBUG -g <BR>
CMAKE_C_FLAGS_MINSIZEREL -Os -DNDEBUG <BR>
CMAKE_C_FLAGS_RELEASE -O3 -DNDEBUG <BR>
CMAKE_C_FLAGS_RELWITHDEBINFO -O2 -g <BR>
CMAKE_EXE_LINKER_FLAGS <BR>
CMAKE_EXE_LINKER_FLAGS_DEBUG <BR>
CMAKE_EXE_LINKER_FLAGS_MINSIZE <BR>
CMAKE_EXE_LINKER_FLAGS_RELEASE <BR>
CMAKE_EXE_LINKER_FLAGS_RELWITH <BR>
CMAKE_INSTALL_PREFIX /usr/local <BR>
CMAKE_LINKER /usr/bin/ld <BR>
CMAKE_MAKE_PROGRAM /usr/bin/make <BR>
CMAKE_MODULE_LINKER_FLAGS <BR>
CMAKE_MODULE_LINKER_FLAGS_DEBU <BR>
CMAKE_MODULE_LINKER_FLAGS_MINS <BR>
CMAKE_MODULE_LINKER_FLAGS_RELE <BR>
CMAKE_MODULE_LINKER_FLAGS_RELW <BR>
CMAKE_NM /usr/bin/nm <BR>
CMAKE_OBJCOPY /usr/bin/objcopy <BR>
CMAKE_OBJDUMP /usr/bin/objdump <BR>
CMAKE_RANLIB /usr/bin/ranlib <BR>
CMAKE_SHARED_LINKER_FLAGS <BR>
CMAKE_SHARED_LINKER_FLAGS_DEBU <BR>
CMAKE_SHARED_LINKER_FLAGS_MINS <BR>
CMAKE_SHARED_LINKER_FLAGS_RELE <BR>
CMAKE_SHARED_LINKER_FLAGS_RELW <BR>
CMAKE_SKIP_RPATH OFF <BR>
CMAKE_STRIP /usr/bin/strip <BR>
CMAKE_USE_RELATIVE_PATHS OFF <BR>
CMAKE_VERBOSE_MAKEFILE OFF <BR>
GDCM_DIR /usr/local/lib/gdcm-2.0 <BR>
ITK_DIR /usr/local/lib/InsightToolkit <BR>
<BR>
<BR>
and my ITK_USE_SYSTEM_GDCM is ON<BR>
and my GDCM_USE_ITK is OFF<BR>
<BR>
Please I need help, I very don't know which is the problem.<BR>
<BR>
Thank you very much for your interest<BR>
Best regards<BR>
Edoardo<BR>
<BR>
<BR>
</FONT>
</P>
</BODY>
</HTML>