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

Ali - saveez at hotmail.com
Wed Sep 5 09:13:48 EDT 2007


> > 
> > 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'
> 
> Try adding this line to the top of itkTestDriver.cxx, but after the 
> #include lines:
> 
> extern template class ITKCommon_EXPORT 
> itk::SmartPointerForwardReference<itk::ProcessObject>;
> 
> This will do the "dllimport" part.  VS has a different import mechanism 
> that makes this "just work" for member functions, but if the class had 
> some public static data members then this would be needed for VS too. 
> If the above works then we will need to add it in 
> itkSmartPointerForwardReference.h in the proper place with a few 
> preprocessing guards.
> 
> -Brad

Sorry, still the same errors. My configuration is for MSYS (not MinGW make), but this should not make a difference.


Scanning dependencies of target itkTestDriver
[ 59%] Building CXX object Code/IO/CMakeFiles/itkTestDriver.dir/itkTestDriver.obj
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


_________________________________________________________________
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/67b65b83/attachment.htm


More information about the Insight-developers mailing list