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

Charles Wang cywang926 at gmail.com
Fri Sep 12 23:31:11 EDT 2008


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20080913/d21a7e8a/attachment.htm>


More information about the Insight-users mailing list