[Dcmlib] Compilation of gdcmunder Windows and Linux

Vincent Daanen vincent.daanen at imag.fr
Thu Feb 23 10:16:03 CET 2006


Bonjour a tous,

I used the latest gdcm1.2 to run my test program and it works fine, both 
with shared and static librairies.

So I try to use my own 'Dicom Image' component (the same tested in the 
test program) in a bigger project which uses MFC (in static lib), stl 
and so on. The project compiles but the link fails with tons of erros like :
msvcprt.lib(MSVCP60.dll) : error LNK2005: "public: __thiscall 
std::ios_base::Init::Init(void)" (??0Init at ios_base@std@@QAE at XZ) already 
defined in libcpmt.lib(iostream.obj)
I guess this is due to conflict between shared and static libs but I'm 
linking only against static libs.

If I do not use gdcm, all is ok, so i think the problem comes from the 
use of gdcm.

Does someone has already encountered such problems and which solution 
exists ?

Thanks 
 

 Vince

Mathieu Malaterre a écrit :
> Salut Vincent,
>
>     We have nightly+continuous dashboard on a variety of machine. I 
> solve *very* recently a nasty bug in gdcm (to work around the brain 
> damaged VS6). So I believe you can only compile the very latest gdcm 
> 1.2 or very latest gdcm CVS.
>
> HTH
> Mathieu
> Ref:
> http://public.kitware.com/pipermail/insight-users/2006-February/016823.html 
>
>
> > Hi,
> > I'm getting the following error while trying to build the cvs version:
> >
> > gdcmSerieHelper.obj : fatal error LNK1179: invalid or corrupt file:
> > duplicate comdat "?sort at std@@YAXPAPAVFile at gdcm@@0P6A_NPAV23 at 
> 1 at Z at Z"
> >
> > I google'd the error and it says it could happen if I have both a /H 
> and
> > a /Gy options to my project in MSVC6 - I don't have either one. Any
> > suggestions?
>
> This should be fixed in current CVS. Sorry for troubles.
>
> Just because I spent too much time on this issue, here is the detail.
> This problem is a big phat 'feature' of the obsolete VS6 compiler. This
> is reported among its other 'features':
> http://support.microsoft.com/kb/q243451/
> -> http://support.microsoft.com/kb/q240871/
>
> A solution is described in detail at:
> http://www.codeguru.com/Cpp/Cpp/cpp_mfc/stl/article.php/c4079/
> or
> http://mail.python.org/pipermail/c++-sig/2003-November/006150.html
>
> Basically I had to create a functor around the function:
> http://www.itk.org/cgi-bin/viewcvs.cgi/Utilities/gdcm/src/gdcmSerieHelper.cxx?root=Insight&sortby=date&r2=1.21&r1=1.20 
>
>
> Hopefully ITK will soon stop supporting VS6 :)
> Mathieu
> Ps: The worse part is that it does not shows up in GDCM own dashboard
> for some bizarre reason...
>
>
> Vincent Daanen wrote:
>> Hi all,
>>
>> I'm a quite new user of gdcm.
>> I succeed in compiling gdcm (both under windows (msvc6) and Linux 
>> (Fedora Core).
>>
>> but :
>>    on a Windows pc, I can only use dll version of the lib because 
>> using static lib generate tons of errors (lnk2005, conflict with 
>> msvcrtd;lib, etc..). In general, I succeed to solve such problems but 
>> not in the case of gdcm. Are there some 'known methods' to use gdcm 
>> static lib with mfc static lib programs ?
>>
>>    on a linux pc : - I can compile gdcm as shared lib and link 
>> against the libs but any program (such as PrintFile) crashes 
>> (segmentation fault !).
>>                          - i can compile but I can't link which 
>> static lib (error with jpeg2000) !
>>
>> Is there a place where I can finn solutions to solve these problems ?
>>
>> thanks
>>
>>
>> vincent
>>
>>
>>
>


-- 
Vincent Daanen, PhD
Research Engineer, Post-Doctoral Position
Laboratoire TIMC/IMAG (Univ. Joseph Fourier - CNRS UMR 5525)
Equipe GMCAO
Institut d'Ingénierie de l'Information de Santé (IN3S)
Faculté de Médecine - 38706 La Tronche cedex - France
Tel: +33 (0)4 56 52 00 54 - Fax: +33 (0)4 56 52 00 55
Vincent.Daanen at imag.fr

"Les problèmes ne peuvent être résolus par
ceux dont l'horizon se limite aux réalités 
quotidiennes, mais par ceux qui rêvent de 
choses qui n'ont jamais existées et qui se 
disent : Pourquoi Pas ?"

J-F Kennedy, 1963.




More information about the Dcmlib mailing list