[Insight-users] link error in building itkRegisterITKMonitorVTK.cxx

Bill Lorensen bill.lorensen at gmail.com
Sat Sep 13 07:59:51 EDT 2008


Charles,

You are missing the ITKNumerics library.
Your TARGET_LINK_LIBRARIES should be:

TARGET_LINK_LIBRARIES(itkRegisterITKMonitorVTK  ITKVTKIntegration
ITKNumerics ITKBasicFilters ITKIO vtkRendering vtkIO vtkHybrid)

Bill

On Fri, Sep 12, 2008 at 11:31 PM, Charles Wang <cywang926 at gmail.com> wrote:
> Dear all,
>
> If using the below CMakeLists.txt (copy from
> InsightApplication\Auxiliary\vtk)
> =======================================================================
> # This project is designed to be built outside the Insight source tree.
> PROJECT(myProject)
> # Find ITK.
> FIND_PACKAGE(ITK REQUIRED)
> IF(ITK_FOUND)
>   INCLUDE(${ITK_USE_FILE})
> ENDIF(ITK_FOUND)
> FIND_PACKAGE (VTK)
> IF ( VTK_FOUND)
>   INCLUDE( ${USE_VTK_FILE} )
> ENDIF( VTK_FOUND)
>
> ADD_LIBRARY(ITKVTKIntegration vtkRegistrationMonitor.cxx vtkKWImage.cxx
> vtkKWImageIO.cxx)
> ADD_EXECUTABLE(itkRegisterITKMonitorVTK itkRegisterITKMonitorVTK.cxx)
> TARGET_LINK_LIBRARIES(itkRegisterITKMonitorVTK  ITKVTKIntegration
> ITKBasicFilters ITKIO vtkRendering vtkIO vtkHybrid)
> =========================================================================
>
> Will cause Link error while using MS visual studio 2005.
> The compiling is ok, and the code "itkRegisterITKMonitorVTK.cxx"  is exactly
> the same as the one in
> InsightApplication\Auxiliary\vtk\itkRegisterITKMonitorVTK.cxx.
>
> Error 5 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@itk@@MBEXAAV?$basic_ostream at DU?$char_traits at D@std@@@std@@VIndent at 2@@Z) itkRegisterITKMonitorVTK.obj
>
> Thanks
>                              Charles
> _______________________________________________
> 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