MantisBT - ITK
View Issue Details
0005647ITKpublic2007-09-03 15:082009-07-30 10:08
Tomas Kazmar 
Luis Ibanez 
normalminoralways
closedfixed 
 
 
0005647: ITK with shared libs on does not compile under MinGW
Current ITK does not compile because MinGW linker does not find some symbols correctly (SmartPointerForwardReference). It fails during linking step of itkTestDriver.exe.

Solution/hack to overcome this bug can be to include itkSmartPointerForwardReference.txx in the source code of every executable, like itkTestDriver.exe, examples or any user application.

The bug is triggered by BUILD_SHARED_LIBS=ON cmake option.

This bug was discussed many times on mailing list since December 2006:
http://www.itk.org/pipermail/insight-users/2006-December/020393.html [^]
http://www.itk.org/pipermail/insight-users/2007-May/022395.html [^] (errors output by linker)
http://www.itk.org/pipermail/insight-users/2007-June/022503.html [^] (hack)
http://www.itk.org/pipermail/insight-users/2007-August/023325.html [^]
http://www.itk.org/pipermail/insight-users/2007-August/023470.html [^] (last paragraph)
ITK+BUILD_SHARED_LIBS+MinGW
No tags attached.
has duplicate 0006724closed Bill Lorensen ITK does not compile on mingw with BUILD_SHARED_LIBS set to ON 
patch itk_mingw_shared_library.patch (511) 2007-09-07 12:42
https://public.kitware.com/Bug/file/1141/itk_mingw_shared_library.patch
Issue History
2007-09-03 15:08Tomas KazmarNew Issue
2007-09-03 15:22Tomas KazmarNote Added: 0008813
2007-09-07 12:41Luis IbanezNote Added: 0008888
2007-09-07 12:41Luis IbanezStatusnew => assigned
2007-09-07 12:41Luis IbanezAssigned To => Luis Ibanez
2007-09-07 12:42Luis IbanezFile Added: itk_mingw_shared_library.patch
2007-09-07 12:47Luis IbanezNote Added: 0008889
2008-01-23 15:50Luis IbanezNote Added: 0010257
2008-05-13 04:45Tom VercauterenRelationship addedhas duplicate 0006724
2009-07-30 10:08Bill LorensenNote Added: 0017023
2009-07-30 10:08Bill LorensenStatusassigned => closed
2009-07-30 10:08Bill LorensenResolutionopen => fixed

Notes
(0008813)
Tomas Kazmar   
2007-09-03 15:22   
Recently there were also two threads in developers mailing list:

[Insight-developers] SmartPointerForwardReference Compile error with mingw
[Insight-developers] Re: [Insight-users] Fixing bugs for ITK with MinGW

This seems as an important bit from the former:

# I think it was for some interaction between ProcessObject and
# DataObject. There is an explicit instantiation of
# SmartPointerForwardReference inside itkDataObject.cxx, but it is not
# dllexport-ed.
(0008888)
Luis Ibanez   
2007-09-07 12:41   
A patch was contributed in the developers list

http://www.itk.org/mailman/private/insight-developers/2007-September/009523.html [^]
(0008889)
Luis Ibanez   
2007-09-07 12:47   
The patch was committed to CVS
http://www.itk.org/cgi-bin/viewcvs.cgi/Code/Common/CMakeLists.txt?root=Insight&sortby=date&r2=1.125&r1=1.124 [^]

and the previous attempt (that didn't work) was removed.
(0010257)
Luis Ibanez   
2008-01-23 15:50   
We need a build of ITK in MinGW with SHARED_LIBS on in order to test this.
(0017023)
Bill Lorensen   
2009-07-30 10:08   
Duplicate bug 6724 resolves the issue. An update to cmake 2.6.4 permits successful shared library builds on cygwin and mingw.