[Insight-users] xxxxxSPAMxxxxx xxxxxSPAMxxxxx help with the "hello world"Registration

Luis Ibanez luis.ibanez at kitware.com
Tue May 25 15:33:07 EDT 2010


Hi  谢谢,


                 Welcome to ITK !


You are simply missing to link with the libraries

      ITKNumerics    and     ITKIO

Please open your CMakeLists.txt file,
look for the command

           TARGET_LINK_LIBRARIES

In your case:

TARGET_LINK_LIBRARIES(ImageRegistration1 ITKCommon)

and add to it ITKNumerics, like:

TARGET_LINK_LIBRARIES(ImageRegistration1
    ITKNumerics    ITKIO   ITKCommon)



   Regards,


           Luis


------------------------------------------
2010/5/12 530426975 <530426975 at qq.com>:
> hi all,
> I met a problem when i bulit the "hello world" Registration ,and got the
> following
> errors.
> The CMakeLists.txt i wrote is that
>> # This is the root ITK CMakeLists file.
> CMAKE_MINIMUM_REQUIRED(VERSION 2.4)
> IF(COMMAND CMAKE_POLICY)
>   CMAKE_POLICY(SET CMP0003 NEW)
> ENDIF(COMMAND CMAKE_POLICY)
> # This project is designed to be built outside the Insight source tree.
> PROJECT(HelloWorldRegistration)
> # Find ITK.
> FIND_PACKAGE(ITK REQUIRED)
> INCLUDE(${ITK_USE_FILE})
> ADD_EXECUTABLE(ImageRegistration1  ImageRegistration1.cxx )
> TARGET_LINK_LIBRARIES(ImageRegistration1 ITKCommon)
>> I thank maybe is CMakeList.txt get something wrong. Please,help me.
> 谢谢
>
>
>
>
>
> --------------------Configuration: ImageRegistration1 - Win32
> Debug--------------------
> Compiling...
> ImageRegistration1.cxx
> Linking...
> ImageRegistration1.obj : error LNK2001: unresolved external symbol
> "protected: virtual void __thiscall
> itk::RegularStepGradientDescentOptimizer::StepAlongGradient(double,class
> itk::Array<double> const &)" (?StepAlongGradient at RegularStepGradientDesce
> ntOptimizer at itk@@MAEXNABV?$Array at N@2@@Z)
> ImageRegistration1.obj : error LNK2001: unresolved external symbol
> "protected: virtual void __thiscall
> itk::RegularStepGradientDescentBaseOptimizer::AdvanceOneStep(void)"
> (?AdvanceOneStep at RegularStepGradientDescentBaseOptimizer@itk@@MAEXXZ)
> ImageRegistration1.obj : error LNK2001: unresolved external symbol "public:
> virtual void __thiscall
> itk::SingleValuedNonLinearOptimizer::SetCostFunction(class
> itk::SingleValuedCostFunction *)"
> (?SetCostFunction at SingleValuedNonLinearOptimizer@itk@@UA
> EXPAVSingleValuedCostFunction at 2@@Z)
> ImageRegistration1.obj : error LNK2001: unresolved external symbol
> "protected: virtual void __thiscall itk::Optimizer::SetCurrentPosition(class
> itk::Array<double> const &)"
> (?SetCurrentPosition at Optimizer@itk@@MAEXABV?$Array at N@2@@Z)
> ImageRegistration1.obj : error LNK2001: unresolved external symbol "public:
> virtual class std::basic_string<char,struct std::char_traits<char>,class
> std::allocator<char> > const __thiscall
> itk::RegularStepGradientDescentBaseOptimizer::GetStopConditi
> onDescription(void)const "
> (?GetStopConditionDescription at RegularStepGradientDescentBaseOptimizer@itk@@UBE?BV?$basic_string at DU?$char_traits at D@std@@V?$allocator at D@2@@std@@XZ)
> ImageRegistration1.obj : error LNK2001: unresolved external symbol "public:
> virtual void __thiscall
> itk::RegularStepGradientDescentBaseOptimizer::StartOptimization(void)"
> (?StartOptimization at RegularStepGradientDescentBaseOptimizer@itk@@UAEXXZ)
> ImageRegistration1.obj : error LNK2001: unresolved external symbol "public:
> virtual void __thiscall itk::Optimizer::SetInitialPosition(class
> itk::Array<double> const &)"
> (?SetInitialPosition at Optimizer@itk@@UAEXABV?$Array at N@2@@Z)
> ImageRegistration1.obj : error LNK2001: unresolved external symbol
> "protected: virtual void __thiscall
> itk::RegularStepGradientDescentBaseOptimizer::PrintSelf(class
> std::basic_ostream<char,struct std::char_traits<char> > &,class
> itk::Indent)const "
> (?PrintSelf at RegularStepGradientDescentBaseOptimizer@itk@@MBEXAAV?$basic_ostream at DU?$char_traits at D@std@@@std@@VIndent at 2@@Z)
> ImageRegistration1.obj : error LNK2001: unresolved external symbol
> "protected: __thiscall
> itk::RegularStepGradientDescentBaseOptimizer::RegularStepGradientDescentBaseOptimizer(void)"
> (??0RegularStepGradientDescentBaseOptimizer at itk@@IAE at XZ)
> ImageRegistration1.obj : error LNK2001: unresolved external symbol "public:
> virtual class std::basic_string<char,struct std::char_traits<char>,class
> std::allocator<char> > const __thiscall
> itk::Optimizer::GetStopConditionDescription(void)const " (?G
> etStopConditionDescription at Optimizer@itk@@UBE?BV?$basic_string at DU?$char_traits at D@std@@V?$allocator at D@2@@std@@XZ)
> ImageRegistration1.obj : error LNK2001: unresolved external symbol
> "protected: virtual void __thiscall
> itk::SingleValuedNonLinearOptimizer::PrintSelf(class
> std::basic_ostream<char,struct std::char_traits<char> > &,class
> itk::Indent)const " (?PrintSe
> lf at SingleValuedNonLinearOptimizer@itk@@MBEXAAV?$basic_ostream at DU?$char_traits at D@std@@@std@@VIndent at 2@@Z)
> ImageRegistration1.obj : error LNK2001: unresolved external symbol
> "protected: virtual void __thiscall itk::Optimizer::PrintSelf(class
> std::basic_ostream<char,struct std::char_traits<char> > &,class
> itk::Indent)const " (?PrintSelf at Optimizer@itk@@MBE
> XAAV?$basic_ostream at DU?$char_traits at D@std@@@std@@VIndent at 2@@Z)
> ImageRegistration1.obj : error LNK2001: unresolved external symbol
> "protected: __thiscall itk::Optimizer::Optimizer(void)"
> (??0Optimizer at itk@@IAE at XZ)
> ImageRegistration1.obj : error LNK2001: unresolved external symbol
> "protected: __thiscall
> itk::SingleValuedNonLinearOptimizer::SingleValuedNonLinearOptimizer(void)"
> (??0SingleValuedNonLinearOptimizer at itk@@IAE at XZ)
> ImageRegistration1.obj : error LNK2001: unresolved external symbol
> "protected: virtual void __thiscall itk::CostFunction::PrintSelf(class
> std::basic_ostream<char,struct std::char_traits<char> > &,class
> itk::Indent)const " (?PrintSelf at CostFunction@it
> k@@MBEXAAV?$basic_ostream at DU?$char_traits at D@std@@@std@@VIndent at 2@@Z)
> ImageRegistration1.obj : error LNK2001: unresolved external symbol "public:
> virtual __thiscall itk::ImageIORegion::~ImageIORegion(void)"
> (??1ImageIORegion at itk@@UAE at XZ)
> ImageRegistration1.obj : error LNK2001: unresolved external symbol "public:
> __thiscall itk::ImageIORegion::ImageIORegion(void)"
> (??0ImageIORegion at itk@@QAE at XZ)
> ImageRegistration1.obj : error LNK2001: unresolved external symbol "public:
> static class itk::SmartPointer<class itk::ImageIOBase> __cdecl
> itk::ImageIOFactory::CreateImageIO(char const *,enum
> itk::ImageIOFactory::FileModeType)" (?CreateImageIO at Image
> IOFactory at itk@@SA?AV?$SmartPointer at VImageIOBase@itk@@@2 at PBDW4FileModeType@12@@Z)
> ImageRegistration1.obj : error LNK2001: 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 cons
> t &)"
> (??6itk@@YAAAV?$basic_ostream at DU?$char_traits at D@std@@@std@@AAV12 at ABVImageIORegion@0@@Z)
> ImageRegistration1.obj : error LNK2001: unresolved external symbol "public:
> void __thiscall itk::ImageIORegion::operator=(class itk::ImageIORegion const
> &)" (??4ImageIORegion at itk@@QAEXABV01@@Z)
> ImageRegistration1.obj : error LNK2001: unresolved external symbol "public:
> __thiscall itk::ImageIORegion::ImageIORegion(unsigned int)"
> (??0ImageIORegion at itk@@QAE at I@Z)
> ImageRegistration1.obj : error LNK2001: unresolved external symbol "public:
> unsigned int __thiscall itk::ImageIORegion::GetNumberOfPixels(void)const "
> (?GetNumberOfPixels at ImageIORegion@itk@@QBEIXZ)
> ImageRegistration1.obj : error LNK2001: unresolved external symbol "public:
> __thiscall itk::ImageIORegion::ImageIORegion(class itk::ImageIORegion const
> &)" (??0ImageIORegion at itk@@QAE at ABV01@@Z)
> ImageRegistration1.obj : error LNK2001: unresolved external symbol "public:
> bool __thiscall itk::ImageIORegion::IsInside(class itk::ImageIORegion const
> &)const " (?IsInside at ImageIORegion@itk@@QBE_NABV12@@Z)
> ImageRegistration1.obj : error LNK2001: unresolved external symbol "public:
> void __thiscall itk::ImageIOBase::SetNumberOfDimensions(unsigned int)"
> (?SetNumberOfDimensions at ImageIOBase@itk@@QAEXI at Z)
> ImageRegistration1.obj : error LNK2001: unresolved external symbol "public:
> void __thiscall itk::ImageIORegion::SetIndex(unsigned long,int)"
> (?SetIndex at ImageIORegion@itk@@QAEXKH at Z)
> ImageRegistration1.obj : error LNK2001: unresolved external symbol "public:
> void __thiscall itk::ImageIORegion::SetSize(unsigned long,unsigned int)"
> (?SetSize at ImageIORegion@itk@@QAEXKI at Z)
> ImageRegistration1.obj : error LNK2001: unresolved external symbol "public:
> unsigned int __thiscall itk::ImageIORegion::GetImageDimension(void)const "
> (?GetImageDimension at ImageIORegion@itk@@QBEIXZ)
> ImageRegistration1.obj : error LNK2001: unresolved external symbol "public:
> int __thiscall itk::ImageIORegion::GetIndex(unsigned long)const "
> (?GetIndex at ImageIORegion@itk@@QBEHK at Z)
> ImageRegistration1.obj : error LNK2001: unresolved external symbol "public:
> unsigned int __thiscall itk::ImageIORegion::GetSize(unsigned long)const "
> (?GetSize at ImageIORegion@itk@@QBEIK at Z)
> ImageRegistration1.obj : error LNK2001: 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::IOCompon
> entType)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)
> F:\MyProgram\ITK+VTK\ITK\hellowRegistration\Debug/ImageRegistration1.exe :
> fatal error LNK1120: 31 unresolved externals
> Error executing link.exe.
> ALL_BUILD - 32 error(s), 0 warning(s)
>
>
>
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Kitware offers ITK Training Courses, for more information visit:
> http://www.kitware.com/products/protraining.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
>
>


More information about the Insight-users mailing list