[Insight-developers] Re: [Insight-users] Fixing bugs for ITK with MinGW

Ali - saveez at hotmail.com
Wed Sep 5 08:10:22 EDT 2007


Luis,

I am on a different machine today which, as well as mingw, has an installation of cygwin. Unfortunately cmake find the cygwin installation in the registery (cugwin bin directory is not in the path) and gives errors of type:

 "...gcc is not able to compile a simple test..."

Putting mingw in the path does not help. Is this a known issue? How is it possible to configure cmake for mingw without uninstalling cygwin?


> 
> 
> Well,
> 
> It turns out that the symbol template class
> 
>       itk::SmartPointerForwardReference<>
> 
> is actually already defined and exported in the file
> 
>     itkSmartPointerForwardReferenceProcessObject.cxx
> 
> 
> but the CMakeLists.txt file only adds it to the list of
> source files if "WIN32" is defined.
> 
> Yesterday, I tried modifying the CMake logic to include 
> itkSmartPointerForwardReferenceProcessObject.cxx in the
> ITKCommon library when we build on MinGW:
> 
> http://www.itk.org/cgi-bin/viewcvs.cgi/Code/Common/CMakeLists.txt.diff?cvsroot=Insight&r1=1.123&r2=1.124
> 
> 
> Lines 90-94:
> 
> 
>     ELSE (WIN32)
>       IF(MINGW)
>         SET(ITKCommon_SRCS ${ITKCommon_SRCS}
>            itkSmartPointerForwardReferenceProcessObject.cxx)
>       ENDIF(MINGW)
>     ENDIF (WIN32)
> 
> 
> 
> However I'm not sure if this is the appropriate logic...
> 
> 
> Ali:   Could you please update your CVS checkout of ITK
>         and give it a try ?
> 
>    You may want to add a MESSAGE() in the middle of the
>    IF(MINGW) to make sure that CMake is actually visiting
>    that line.
> 
> 
>    Please let us know if this change works for you,
> 
> 
>       Thanks
> 
> 
> 
>           Luis
> 
> 
> 
> -----------------
> Ali - wrote:
> > 
> >  >
> >  > The export syntax in Luis's patch was incorrect. Try this instead:
> >  >
> >  > template class ITKCommon_EXPORT
> >  > itk::SmartPointerForwardReference<itk::ProcessObject>;
> >  >
> >  > -Brad
> >  >
> > 
> > 
> > Of course. This links the shared library, however, now the same old 
> > problem is back again: the tests fail (see the end of this message). How 
> > come this does not happen to visual studio?
> > 
> > 
> > Linking CXX executable ../../bin/itkTestDriver.exe
> > CMakeFiles/itkTestDriver.dir/itkTestDriver.obj:itkTestDriver.cxx:(.text$_ZN3itk15ImageFileWriterINS_5ImageIhLj2EEEE5WriteEv[itk::ImageFileWriter<itk::Image<unsigned 
> > char, 2u> >::Write()]+0x12c7): undefined reference to 
> > `itk::SmartPointerForwardReference<itk::ProcessObject>::operator 
> > itk::ProcessObject*() const'
> > CMakeFiles/itkTestDriver.dir/itkTestDriver.obj:itkTestDriver.cxx:(.text$_ZN3itk15ImageFileWriterINS_5ImageIhLj2EEEE5WriteEv[itk::ImageFileWriter<itk::Image<unsigned 
> > char, 2u> >::Write()]+0x12f3): undefined reference to 
> > `itk::SmartPointerForwardReference<itk::ProcessObject>::~SmartPointerForwardReference()'
> > CMakeFiles/itkTestDriver.dir/itkTestDriver.obj:itkTestDriver.cxx:(.text$_ZN3itk15ImageFileWriterINS_5ImageIhLj2EEEE5WriteEv[itk::ImageFileWriter<itk::Image<unsigned 
> > char, 2u> >::Write()]+0x132f): undefined reference to 
> > `itk::SmartPointerForwardReference<itk::ProcessObject>::~SmartPointerForwardReference()'
> > CMakeFiles/itkTestDriver.dir/itkTestDriver.obj:itkTestDriver.cxx:(.text$_ZN3itk15ImageFileWriterINS_5ImageIhLj2EEEE5WriteEv[itk::ImageFileWriter<itk::Image<unsigned 
> > char, 2u> >::Write()]+0x1371): undefined reference to 
> > `itk::SmartPointerForwardReference<itk::ProcessObject>::operator->() const'
> > CMakeFiles/itkTestDriver.dir/itkTestDriver.obj:itkTestDriver.cxx:(.text$_ZN3itk15ImageFileWriterINS_5ImageIhLj2EEEE5WriteEv[itk::ImageFileWriter<itk::Image<unsigned 
> > char, 2u> >::Write()]+0x13a3): undefined reference to 
> > `itk::SmartPointerForwardReference<itk::ProcessObject>::~SmartPointerForwardReference()'
> > CMakeFiles/itkTestDriver.dir/itkTestDriver.obj:itkTestDriver.cxx:(.text$_ZN3itk15ImageFileWriterINS_5ImageIhLj2EEEE5WriteEv[itk::ImageFileWriter<itk::Image<unsigned 
> > char, 2u> >::Write()]+0x13df): undefined reference to 
> > `itk::SmartPointerForwardReference<itk::ProcessObject>::~SmartPointerForwardReference()'
> > CMakeFiles/itkTestDriver.dir/itkTestDriver.obj:itkTestDriver.cxx:(.text$_ZN3itk9ImageBaseILj2EE23UpdateOutputInformationEv[itk::ImageBase<2u>::UpdateOutputInformation()]+0x64): 
> > undefined reference to 
> > `itk::SmartPointerForwardReference<itk::ProcessObject>::operator 
> > itk::ProcessObject*() const'
> > CMakeFiles/itkTestDriver.dir/itkTestDriver.obj:itkTestDriver.cxx:(.text$_ZN3itk9ImageBaseILj2EE23UpdateOutputInformationEv[itk::ImageBase<2u>::UpdateOutputInformation()]+0x81): 
> > undefined reference to 
> > `itk::SmartPointerForwardReference<itk::ProcessObject>::~SmartPointerForwardReference()'
> > CMakeFiles/itkTestDriver.dir/itkTestDriver.obj:itkTestDriver.cxx:(.text$_ZN3itk9ImageBaseILj2EE23UpdateOutputInformationEv[itk::ImageBase<2u>::UpdateOutputInformation()]+0xab): 
> > undefined reference to 
> > `itk::SmartPointerForwardReference<itk::ProcessObject>::~SmartPointerForwardReference()'
> > CMakeFiles/itkTestDriver.dir/itkTestDriver.obj:itkTestDriver.cxx:(.text$_ZN3itk9ImageBaseILj2EE23UpdateOutputInformationEv[itk::ImageBase<2u>::UpdateOutputInformation()]+0xde): 
> > undefined reference to 
> > `itk::SmartPointerForwardReference<itk::ProcessObject>::operator->() const'
> > CMakeFiles/itkTestDriver.dir/itkTestDriver.obj:itkTestDriver.cxx:(.text$_ZN3itk9ImageBaseILj2EE23UpdateOutputInformationEv[itk::ImageBase<2u>::UpdateOutputInformation()]+0x119): 
> > undefined reference to 
> > `itk::SmartPointerForwardReference<itk::ProcessObject>::~SmartPointerForwardReference()'
> > CMakeFiles/itkTestDriver.dir/itkTestDriver.obj:itkTestDriver.cxx:(.text$_ZN3itk9ImageBaseILj2EE23UpdateOutputInformationEv[itk::ImageBase<2u>::UpdateOutputInformation()]+0x143): 
> > undefined reference to 
> > `itk::SmartPointerForwardReference<itk::ProcessObject>::~SmartPointerForwardReference()'
> > CMakeFiles/itkTestDriver.dir/itkTestDriver.obj:itkTestDriver.cxx:(.text$_ZN3itk9ImageBaseILj6EE23UpdateOutputInformationEv[itk::ImageBase<6u>::UpdateOutputInformation()]+0x64): 
> > undefined reference to 
> > `itk::SmartPointerForwardReference<itk::ProcessObject>::operator 
> > itk::ProcessObject*() const'
> > CMakeFiles/itkTestDriver.dir/itkTestDriver.obj:itkTestDriver.cxx:(.text$_ZN3itk9ImageBaseILj6EE23UpdateOutputInformationEv[itk::ImageBase<6u>::UpdateOutputInformation()]+0x81): 
> > undefined reference to 
> > `itk::SmartPointerForwardReference<itk::ProcessObject>::~SmartPointerForwardReference()'
> > CMakeFiles/itkTestDriver.dir/itkTestDriver.obj:itkTestDriver.cxx:(.text$_ZN3itk9ImageBaseILj6EE23UpdateOutputInformationEv[itk::ImageBase<6u>::UpdateOutputInformation()]+0xab): 
> > undefined reference to 
> > `itk::SmartPointerForwardReference<itk::ProcessObject>::~SmartPointerForwardReference()'
> > CMakeFiles/itkTestDriver.dir/itkTestDriver.obj:itkTestDriver.cxx:(.text$_ZN3itk9ImageBaseILj6EE23UpdateOutputInformationEv[itk::ImageBase<6u>::UpdateOutputInformation()]+0xde): 
> > undefined reference to 
> > `itk::SmartPointerForwardReference<itk::ProcessObject>::operator->() const'
> > CMakeFiles/itkTestDriver.dir/itkTestDriver.obj:itkTestDriver.cxx:(.text$_ZN3itk9ImageBaseILj6EE23UpdateOutputInformationEv[itk::ImageBase<6u>::UpdateOutputInformation()]+0x119): 
> > undefined reference to 
> > `itk::SmartPointerForwardReference<itk::ProcessObject>::~SmartPointerForwardReference()'
> > CMakeFiles/itkTestDriver.dir/itkTestDriver.obj:itkTestDriver.cxx:(.text$_ZN3itk9ImageBaseILj6EE23UpdateOutputInformationEv[itk::ImageBase<6u>::UpdateOutputInformation()]+0x143): 
> > undefined reference to 
> > `itk::SmartPointerForwardReference<itk::ProcessObject>::~SmartPointerForwardReference()'
> > collect2: ld returned 1 exit status
> > make[2]: *** [bin/itkTestDriver.exe] Error 1
> > make[1]: *** [Code/IO/CMakeFiles/itkTestDriver.dir/all] Error 2
> > make: *** [all] Error 2
> > 
> > 
> > ------------------------------------------------------------------------
> > Get free emoticon packs and customisation from Windows Live. Pimp My 
> > Live! <http://www.pimpmylive.co.uk>

_________________________________________________________________
Celeb spotting – Play CelebMashup and win cool prizes
https://www.celebmashup.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.itk.org/mailman/private/insight-developers/attachments/20070905/c3ff1a2e/attachment.htm


More information about the Insight-developers mailing list