[Insight-users] Linker-Problem with ITK-DICOM-EXAMPLE

Clemens M. Hentschke paradise.devil at gmx.net
Mon Jul 3 15:57:06 EDT 2006


Hi Vince,

unfortunately this doesnt change anything about the linker problem..., 
any other ideas?

Clemens

Vincent A. Magnotta schrieb:
> Clemens,
>
> You should be able to eliminate this section from your code:
>
>   typedef itk::GDCMImageIO ImageIOType;
>
>   ImageIOType::Pointer gdcmImageIO = ImageIOType::New();
>
>   reader->SetImageIO( gdcmImageIO );
>
> ITK image reader factory should automatically determine the type of file
> and call the appropriate reader based on the file extension.
>
> Vince
>
>
> On Mon, 2006-07-03 at 14:48 +0200, Clemens M. Hentschke wrote:
>   
>> Hello, 
>>
>>
>> I just tried to get the DICOM-reader Demo from the ITK-Software-Guide 
>> (p. 327) to run with Microsoft Visual Studio 7. My ITK-Version is 2.6 
>> and the code is as follows:
>>
>>
>>
>> #include "itkImage.h"
>>
>> #include <iostream>
>>
>> #include "itkImageFileReader.h"
>>
>> #include "itkImageFileWriter.h"
>>
>> #include "itkRescaleIntensityImageFilter.h"
>>
>> #include "itkGDCMImageIO.h"
>>
>> #include <itkSmartPointer.h>
>>
>>
>> int main()
>>
>> {
>>
>>   typedef signed short InputPixelType;
>>
>>   const unsigned int InputDimension = 2;
>>
>>   typedef itk::Image< InputPixelType, InputDimension > InputImageType;
>>
>>   
>>
>>   typedef itk::ImageFileReader< InputImageType > ReaderType;
>>
>>   ReaderType::Pointer reader = ReaderType::New();
>>
>>   reader->SetFileName( "test.dcm" );
>>
>>
>>   typedef itk::GDCMImageIO ImageIOType;
>>
>>   ImageIOType::Pointer gdcmImageIO = ImageIOType::New();
>>
>>   reader->SetImageIO( gdcmImageIO );
>>
>>
>>     try
>>
>>        {
>>
>>        reader->Update();
>>
>>        }
>>
>>        catch (itk::ExceptionObject & e)
>>
>>        {
>>
>>        std::cerr << "exception in file reader " << std::endl;
>>
>>        std::cerr << e << std::endl;
>>
>>        return EXIT_FAILURE;
>>
>>        }
>>
>>   
>>
>>        return 0;
>>
>> }
>>
>>
>> When I try to build the project there's a linker error:
>>
>>
>> Linking...
>>
>> HelloWorld.obj : error LNK2019: unresolved external symbol "protected: 
>> __thiscall itk::GDCMImageIO::GDCMImageIO(void)" 
>> (??0GDCMImageIO at itk@@IAE at XZ) referenced in function "public: static 
>> class itk::SmartPointer<class itk::GDCMImageIO> __cdecl 
>> itk::GDCMImageIO::New(void)" 
>> (?New at GDCMImageIO@itk@@SA?AV?$SmartPointer at VGDCMImageIO@itk@@@2 at XZ)
>>
>> HelloWorld.obj : error LNK2001: unresolved external symbol "protected: 
>> virtual void __thiscall itk::ImageIORegion::PrintSelf(class 
>> std::basic_ostream<char,struct std::char_traits<char> > &,class 
>> itk::Indent)const " 
>> (?PrintSelf at ImageIORegion@itk@@MBEXAAV?$basic_ostream at DU?$char_traits at D@std@@@std@@VIndent at 2@@Z)
>>
>> HelloWorld.obj : error LNK2019: unresolved external symbol "public: 
>> unsigned int __thiscall itk::ImageIOBase::GetImageSizeInBytes(void)const 
>> " (?GetImageSizeInBytes at ImageIOBase@itk@@QBEIXZ) referenced in function 
>> "protected: virtual void __thiscall itk::ImageFileReader<class 
>> itk::Image<short,2>,class itk::DefaultConvertPixelTraits<short> 
>>  >::GenerateData(void)" 
>> (?GenerateData@?$ImageFileReader at V?$Image at F$01 at itk@@V?$DefaultConvertPixelTraits at F@2@@itk@@MAEXXZ)
>>
>> HelloWorld.obj : error LNK2019: unresolved external symbol "class 
>> std::basic_ostream<char,struct std::char_traits<char> > & __cdecl 
>> itk::operator<<(class std::basic_ostream<char,struct 
>> std::char_traits<char> > &,class itk::ImageIORegion const &)" 
>> (??6itk@@YAAAV?$basic_ostream at DU?$char_traits at D@std@@@std@@AAV12 at ABVImageIORegion@0@@Z) 
>> referenced in function "protected: virtual void __thiscall 
>> itk::ImageFileReader<class itk::Image<short,2>,class 
>> itk::DefaultConvertPixelTraits<short> >::GenerateData(void)" 
>> (?GenerateData@?$ImageFileReader at V?$Image at F$01 at itk@@V?$DefaultConvertPixelTraits at F@2@@itk@@MAEXXZ)
>>
>> HelloWorld.obj : error LNK2019: unresolved external symbol "public: 
>> class std::basic_string<char,struct std::char_traits<char>,class 
>> std::allocator<char> > __thiscall 
>> itk::ImageIOBase::GetComponentTypeAsString(enum 
>> itk::ImageIOBase::IOComponentType)const " 
>> (?GetComponentTypeAsString at ImageIOBase@itk@@QBE?AV?$basic_string at DU?$char_traits at D@std@@V?$allocator at D@2@@std@@W4IOComponentType at 12@@Z) 
>> referenced in function "protected: void __thiscall 
>> itk::ImageFileReader<class itk::Image<short,2>,class 
>> itk::DefaultConvertPixelTraits<short> >::DoConvertBuffer(void *,unsigned 
>> long)" 
>> (?DoConvertBuffer@?$ImageFileReader at V?$Image at F$01 at itk@@V?$DefaultConvertPixelTraits at F@2@@itk@@IAEXPAXK at Z)
>>
>> HelloWorld.obj : error LNK2019: unresolved external symbol "public: 
>> static class itk::SmartPointer<class itk::ImageIOBase> __cdecl 
>> itk::ImageIOFactory::CreateImageIO(char const *,enum 
>> itk::ImageIOFactory::FileModeType)" 
>> (?CreateImageIO at ImageIOFactory@itk@@SA?AV?$SmartPointer at VImageIOBase@itk@@@2 at PBDW4FileModeType@12@@Z) 
>> referenced in function "public: virtual void __thiscall 
>> itk::ImageFileReader<class itk::Image<short,2>,class 
>> itk::DefaultConvertPixelTraits<short> 
>>  >::GenerateOutputInformation(void)" 
>> (?GenerateOutputInformation@?$ImageFileReader at V?$Image at F$01 at itk@@V?$DefaultConvertPixelTraits at F@2@@itk@@UAEXXZ)
>>
>> Release\HelloWorld.exe : fatal error LNK1120: 6 unresolved externals
>>
>>
>> I'm a new user of ITK and I have no idea why this Linker-error occurs. 
>> Does anybody else have some suggestions?
>>
>> Thank you!
>>
>>
>> Basti
>>
>> _______________________________________________
>> Insight-users mailing list
>> Insight-users at itk.org
>> http://www.itk.org/mailman/listinfo/insight-users
>>
>>     



More information about the Insight-users mailing list