<!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>I: [Gdcm2] Problem with ITK and GDCM in the same program</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/plain format -->
<P><FONT SIZE=2>Hi, thank you very much for your interest.<BR>
I can't use the first way because I need to extract SequenceOfUltrasoundRegion from the header dicom, which are tags that I can't extract using the embedded gdcm libraries in itk.<BR>
The second way it is not very clear for me. First of all I use Linux and not Windows, and after that I don't know how can I link ITK and GDCM libraries without cmake.<BR>
<BR>
But my problem is that I have a multiple definition of `gdcm::Global::~Global() indeed my output is:<BR>
edoardo@edoardo-laptop:~/ITK/Tesi/01_Autocrop/crop/bin$ make<BR>
-- Configuring done<BR>
-- Generating done<BR>
-- Build files have been written to: /home/edoardo/ITK/Tesi/01_Autocrop/crop/bin<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>
Please I need help because I have to join all my works with this piece of code that use gdcm library.<BR>
Thank you very much for interest<BR>
<BR>
Edoardo<BR>
<BR>
<BR>
-----Messaggio originale-----<BR>
Da: Mark Roden [<A HREF="mailto:mmroden@gmail.com">mailto:mmroden@gmail.com</A>]<BR>
Inviato: gio 13/05/2010 16.05<BR>
A: edoardo.belletti@alice.it<BR>
Cc: GDCM-developers<BR>
Oggetto: Re: [Gdcm2] Problem with ITK and GDCM in the same program<BR>
<BR>
Hi Eduardo,<BR>
<BR>
There are two ways I use to get itk and gdcm to play nice with each other.<BR>
<BR>
One, you can use the embedded gdcm libraries in itk. I've attached a<BR>
class of my own that I use for reading CT image slices. This class is<BR>
an adaptations of the example code in the itk instructions; I wrote<BR>
the class because I found myself reading CT images quite a bit.<BR>
Hopefully, it'll be helpful to you.<BR>
<BR>
The CMaskLists.txt for including the class is pretty straightforward:<BR>
<BR>
ADD_EXECUTABLE(myproject myproject.cxx CTSeriesReader.h<BR>
CTSeriesReader.cpp itkInclude.h)<BR>
TARGET_LINK_LIBRARIES(myproject ITKCommon ITKIO ITKIOReview)<BR>
<BR>
That compiles and works for me.<BR>
<BR>
The other approach is to use the itk flat directory install CMake<BR>
option in ITK. Once you install ITK and gdcm (and it can't be to the<BR>
default C:\program files directory on windows 7, as that's now a<BR>
protected directory), you can then link to those include directories<BR>
from your own project, and build without using cmake. This approach<BR>
is more involved, but allows you to debug into the libraries much more<BR>
easily than the CMake version (at least, that's been my experience in<BR>
visual studio 2008). If you don't do a flat install, you'll find<BR>
yourself tracing a very large include tree to get everything that's<BR>
necessary to just read in a file.<BR>
<BR>
I hope that this helps, and please let me know if you need more,<BR>
<BR>
Mark<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
</FONT>
</P>
</BODY>
</HTML>