[Insight-users] ITK link error

Luis Ibanez luis.ibanez at kitware.com
Tue May 5 21:15:01 EDT 2009



Hi Ahmet,


           Thanks for posting the link error messages.


They indicate that you are mixing different types of compilation modes.
It is a common mistake to build ITK for "Debug" and then attempt to
build your application for "Release" or the other way around.

The linker is telling you that you are mixing two incompatible 
compilation modes:


       warning LNK4098: defaultlib 'MSVCRT'
       conflicts with use of other libs;



Visibly you are not using CMake to configure your project.

You will not be facing these difficulties if you were using CMake.
CMake will take care of making sure that all your libraries are
build consistently.


Please use CMake to configure your project, or at least make sure
that you build *ALL* your libraries with *EXACTLY THE SAME* compilation
options. In particular "Debug vs Release" and "Multi-threaded vs
Single-Threaded."



      Regards,


          Luis



---------------------
ahmet erdem wrote:
> Hi Selim,
> 
> The message is:
> 1>LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of
> other libs; use /NODEFAULTLIB:library
> 1>vtk_minimal.obj : error LNK2019: unresolved external symbol "public:
> class std::vector<class itk::MetaDataDictionary *,class
> std::allocator<class itk::MetaDataDictionary *> > const * __thiscall
> itk::ImageSeriesReader<class itk::Image<short,3>
> 
>>::GetMetaDataDictionaryArray(void)const "
> 
> (?GetMetaDataDictionaryArray@?$ImageSeriesReader at V?$Image at F$02 at itk@@@itk@@QBEPBV?$vector at PAVMetaDataDictionary@itk@@V?$allocator at PAVMetaDataDictionary@itk@@@std@@@std@@XZ)
> referenced in function __catch$?dicomReader@@YAHXZ$0
> 1>vtk_minimal.obj : error LNK2019: unresolved external symbol "public:
> void __thiscall itk::ImageSeriesWriter<class itk::Image<short,3>,class
> itk::Image<short,2> >::SetInput(class itk::Image<short,3> const *)"
> (?SetInput@?$ImageSeriesWriter at V?$Image at F$02 at itk@@V?$Image at F$01 at 2@@itk@@QAEXPBV?$Image at F$02 at 2@@Z)
> referenced in function __catch$?dicomReader@@YAHXZ$0
> 1>vtk_minimal.obj : error LNK2019: unresolved external symbol "public:
> class itk::Image<short,3> * __thiscall itk::ImageSource<class
> itk::Image<short,3> >::GetOutput(void)"
> (?GetOutput@?$ImageSource at V?$Image at F$02 at itk@@@itk@@QAEPAV?$Image at F$02 at 2@XZ)
> referenced in function __catch$?dicomReader@@YAHXZ$0
> 1>vtk_minimal.obj : error LNK2019: unresolved external symbol
> "protected: __thiscall itk::ImageSeriesWriter<class
> itk::Image<short,3>,class itk::Image<short,2>
> 
>>::ImageSeriesWriter<class itk::Image<short,3>,class
> 
> itk::Image<short,2> >(void)"
> (??0?$ImageSeriesWriter at V?$Image at F$02 at itk@@V?$Image at F$01 at 2@@itk@@IAE at XZ)
> referenced in function "public: static class itk::SmartPointer<class
> itk::ImageSeriesWriter<class itk::Image<short,3>,class
> itk::Image<short,2> > > __cdecl itk::ImageSeriesWriter<class
> itk::Image<short,3>,class itk::Image<short,2> >::New(void)"
> (?New@?$ImageSeriesWriter at V?$Image at F$02 at itk@@V?$Image at F$01 at 2@@itk@@SA?AV?$SmartPointer at V?$ImageSeriesWriter at V?$Image at F$02 at itk@@V?$Image at F$01 at 2@@itk@@@2 at XZ)
> 1>vtk_minimal.obj : error LNK2019: unresolved external symbol
> "protected: __thiscall itk::ImageSource<class itk::Image<short,3>
> 
>>::ImageSource<class itk::Image<short,3> >(void)"
> 
> (??0?$ImageSource at V?$Image at F$02 at itk@@@itk@@IAE at XZ) referenced in
> function "protected: __thiscall itk::ImageSeriesReader<class
> itk::Image<short,3> >::ImageSeriesReader<class itk::Image<short,3>
> 
>>(void)" (??0?$ImageSeriesReader at V?$Image at F$02 at itk@@@itk@@IAE at XZ)
> 
> 1>vtk_minimal.obj : error LNK2001: unresolved external symbol
> "protected: virtual void __thiscall itk::ImageSeriesReader<class
> itk::Image<short,3> >::PrintSelf(class std::basic_ostream<char,struct
> std::char_traits<char> > &,class itk::Indent)const "
> (?PrintSelf@?$ImageSeriesReader at V?$Image at F$02 at itk@@@itk@@MBEXAAV?$basic_ostream at DU?$char_traits at D@std@@@std@@VIndent at 2@@Z)
> 1>vtk_minimal.obj : error LNK2001: unresolved external symbol "public:
> virtual void __thiscall itk::ImageSeriesReader<class
> itk::Image<short,3> >::EnlargeOutputRequestedRegion(class
> itk::DataObject *)"
> (?EnlargeOutputRequestedRegion@?$ImageSeriesReader at V?$Image at F$02 at itk@@@itk@@UAEXPAVDataObject at 2@@Z)
> 1>vtk_minimal.obj : error LNK2001: unresolved external symbol "public:
> virtual class itk::SmartPointer<class itk::DataObject> __thiscall
> itk::ImageSource<class itk::Image<short,3> >::MakeOutput(unsigned
> int)" (?MakeOutput@?$ImageSource at V?$Image at F$02 at itk@@@itk@@UAE?AV?$SmartPointer at VDataObject@itk@@@2 at I@Z)
> 1>vtk_minimal.obj : error LNK2001: unresolved external symbol "public:
> virtual void __thiscall itk::ImageSeriesReader<class
> itk::Image<short,3> >::GenerateOutputInformation(void)"
> (?GenerateOutputInformation@?$ImageSeriesReader at V?$Image at F$02 at itk@@@itk@@UAEXXZ)
> 1>vtk_minimal.obj : error LNK2001: unresolved external symbol
> "protected: virtual void __thiscall itk::ImageSeriesReader<class
> itk::Image<short,3> >::GenerateData(void)"
> (?GenerateData@?$ImageSeriesReader at V?$Image at F$02 at itk@@@itk@@MAEXXZ)
> 1>vtk_minimal.obj : error LNK2001: unresolved external symbol "public:
> virtual void __thiscall itk::ImageSource<class itk::Image<short,3>
> 
>>::GraftOutput(class itk::DataObject *)"
> 
> (?GraftOutput@?$ImageSource at V?$Image at F$02 at itk@@@itk@@UAEXPAVDataObject at 2@@Z)
> 1>vtk_minimal.obj : error LNK2001: unresolved external symbol "public:
> virtual void __thiscall itk::ImageSource<class itk::Image<short,3>
> 
>>::GraftNthOutput(unsigned int,class itk::DataObject *)"
> 
> (?GraftNthOutput@?$ImageSource at V?$Image at F$02 at itk@@@itk@@UAEXIPAVDataObject at 2@@Z)
> 1>vtk_minimal.obj : error LNK2001: unresolved external symbol
> "protected: virtual void __thiscall itk::ImageSource<class
> itk::Image<short,3> >::ThreadedGenerateData(class itk::ImageRegion<3>
> const &,int)" (?ThreadedGenerateData@?$ImageSource at V?$Image at F$02 at itk@@@itk@@MAEXABV?$ImageRegion@$02 at 2@H at Z)
> 1>vtk_minimal.obj : error LNK2001: unresolved external symbol
> "protected: virtual void __thiscall itk::ImageSource<class
> itk::Image<short,3> >::AllocateOutputs(void)"
> (?AllocateOutputs@?$ImageSource at V?$Image at F$02 at itk@@@itk@@MAEXXZ)
> 1>vtk_minimal.obj : error LNK2001: unresolved external symbol
> "protected: virtual int __thiscall itk::ImageSource<class
> itk::Image<short,3> >::SplitRequestedRegion(int,int,class
> itk::ImageRegion<3> &)"
> (?SplitRequestedRegion@?$ImageSource at V?$Image at F$02 at itk@@@itk@@MAEHHHAAV?$ImageRegion@$02 at 2@@Z)
> 1>vtk_minimal.obj : error LNK2001: unresolved external symbol
> "protected: virtual void __thiscall itk::ImageSource<class
> itk::Image<short,3> >::GenerateData(void)"
> (?GenerateData@?$ImageSource at V?$Image at F$02 at itk@@@itk@@MAEXXZ)
> 1>vtk_minimal.obj : error LNK2019: unresolved external symbol
> "protected: virtual __thiscall itk::ImageSeriesReader<class
> itk::Image<short,3> >::~ImageSeriesReader<class itk::Image<short,3>
> 
>>(void)" (??1?$ImageSeriesReader at V?$Image at F$02 at itk@@@itk@@MAE at XZ)
> 
> referenced in function "protected: virtual void * __thiscall
> itk::ImageSeriesReader<class itk::Image<short,3> >::`scalar deleting
> destructor'(unsigned int)"
> (??_G?$ImageSeriesReader at V?$Image at F$02 at itk@@@itk@@MAEPAXI at Z)
> 1>Debug/../bin/vtk_minimal_d.exe : fatal error LNK1120: 17 unresolved externals
> 
> 2009/5/5 Selim Hasan <selimhasan at gmail.com>:
> 
>>Hi Ahmet,
>>
>>Could you send the LNK error message?
>>
>>On Tue, May 5, 2009 at 10:37 AM, ahmet erdem <ahmet.erdem at gmail.com> wrote:
>>
>>>Hello,
>>>I want to ask a question about a link error while using insight.
>>>I downloaded the source  code
>>>and  using cmake and  visual studio 2005 project
>>>I produced insight libraries.
>>>I added all the produced insight libraries into my visual c++ project
>>>I tried to use the dicom reader example from the manual.
>>>But the project gives link errors when I used the itk::ImageSeriesReader
>>>Can anyone help me about the reason of these link error.
>>>--------------------------------------------------------------------------
>>>                          Ahmet Erdem
>>>--------------------------------------------------------------------------
>>>_____________________________________
>>>Powered by www.kitware.com
>>>
>>>Visit other Kitware open-source projects at
>>>http://www.kitware.com/opensource/opensource.html
>>>
>>>Please keep messages on-topic and check the ITK FAQ at:
>>>http://www.itk.org/Wiki/ITK_FAQ
>>>
>>>Follow this link to subscribe/unsubscribe:
>>>http://www.itk.org/mailman/listinfo/insight-users
>>
>>
>>
>>--
>>Selim Hasan
>>
>>Yeditepe University
>>Computer Science Engineering
>>
>>selimhasan at gmail.com
>>
> 
> 
> 
> 


More information about the Insight-users mailing list