ITK 4.3.1 + VTK 编程 问题

编写好CMakeList.txt,生成 vs2008工程文件后,打开,编译出现

1>myProject.obj : error LNK2001: 无法解析的外部符号 "void __cdecl itk::HDF5ImageIOFactoryRegister__Private(void)" (?HDF5ImageIOFactoryRegister__Private@itk@@YAXXZ)
1>myProject.obj : error LNK2001: 无法解析的外部符号 "void __cdecl itk::GiplImageIOFactoryRegister__Private(void)" (?GiplImageIOFactoryRegister__Private@itk@@YAXXZ)
1>myProject.obj : error LNK2001: 无法解析的外部符号 "void __cdecl itk::NrrdImageIOFactoryRegister__Private(void)" (?NrrdImageIOFactoryRegister__Private@itk@@YAXXZ)
1>myProject.obj : error LNK2001: 无法解析的外部符号 "void __cdecl itk::NiftiImageIOFactoryRegister__Private(void)" (?NiftiImageIOFactoryRegister__Private@itk@@YAXXZ)
1>myProject.obj : error LNK2001: 无法解析的外部符号 "void __cdecl itk::MetaImageIOFactoryRegister__Private(void)" (?MetaImageIOFactoryRegister__Private@itk@@YAXXZ)
1>myProject.obj : error LNK2001: 无法解析的外部符号 "void __cdecl itk::BioRadImageIOFactoryRegister__Private(void)" (?BioRadImageIOFactoryRegister__Private@itk@@YAXXZ)
1>myProject.obj : error LNK2001: 无法解析的外部符号 "void __cdecl itk::StimulateImageIOFactoryRegister__Private(void)" (?StimulateImageIOFactoryRegister__Private@itk@@YAXXZ)
1>myProject.obj : error LNK2001: 无法解析的外部符号 "void __cdecl itk::VTKImageIOFactoryRegister__Private(void)" (?VTKImageIOFactoryRegister__Private@itk@@YAXXZ)
1>myProject.obj : error LNK2001: 无法解析的外部符号 "void __cdecl itk::TIFFImageIOFactoryRegister__Private(void)" (?TIFFImageIOFactoryRegister__Private@itk@@YAXXZ)
1>myProject.obj : error LNK2001: 无法解析的外部符号 "void __cdecl itk::PNGImageIOFactoryRegister__Private(void)" (?PNGImageIOFactoryRegister__Private@itk@@YAXXZ)
1>myProject.obj : error LNK2001: 无法解析的外部符号 "void __cdecl itk::LSMImageIOFactoryRegister__Private(void)" (?LSMImageIOFactoryRegister__Private@itk@@YAXXZ)
1>myProject.obj : error LNK2001: 无法解析的外部符号 "void __cdecl itk::BMPImageIOFactoryRegister__Private(void)" (?BMPImageIOFactoryRegister__Private@itk@@YAXXZ)
1>myProject.obj : error LNK2001: 无法解析的外部符号 "void __cdecl itk::GDCMImageIOFactoryRegister__Private(void)" (?GDCMImageIOFactoryRegister__Private@itk@@YAXXZ)
1>myProject.obj : error LNK2001: 无法解析的外部符号 "void __cdecl itk::JPEGImageIOFactoryRegister__Private(void)" (?JPEGImageIOFactoryRegister__Private@itk@@YAXXZ)



等错误。


解决方法


在VS2008 上,工程右键,属性-配置属性-连接器,添加 以下库后,编译解决

kernel32.lib
user32.lib
gdi32.lib
winspool.lib
shell32.lib
ole32.lib
oleaut32.lib
uuid.lib
comdlg32.lib
advapi32.lib
E:\itk\InsightToolkit-4.3.1_Bin\lib\Debug\ITKCommon-4.3.lib
E:\itk\VTK5.10.1_Bin\bin\Debug\vtkRendering.lib
E:\itk\VTK5.10.1_Bin\bin\Debug\vtkGraphics.lib
E:\itk\VTK5.10.1_Bin\bin\Debug\vtkHybrid.lib
E:\itk\VTK5.10.1_Bin\bin\Debug\vtkImaging.lib
E:\itk\VTK5.10.1_Bin\bin\Debug\vtkIO.lib
E:\itk\VTK5.10.1_Bin\bin\Debug\vtkFiltering.lib
E:\itk\VTK5.10.1_Bin\bin\Debug\vtkCommon.lib
E:\itk\InsightToolkit-4.3.1_Bin\lib\Debug\itksys-4.3.lib
Psapi.lib
E:\itk\InsightToolkit-4.3.1_Bin\lib\Debug\ITKVNLInstantiation-4.3.lib
E:\itk\InsightToolkit-4.3.1_Bin\lib\Debug\itkvnl_algo-4.3.lib
E:\itk\InsightToolkit-4.3.1_Bin\lib\Debug\itkv3p_lsqr-4.3.lib
E:\itk\InsightToolkit-4.3.1_Bin\lib\Debug\itkvnl-4.3.lib
E:\itk\InsightToolkit-4.3.1_Bin\lib\Debug\itkvcl-4.3.lib
E:\itk\InsightToolkit-4.3.1_Bin\lib\Debug\itkv3p_netlib-4.3.lib
E:\itk\VTK5.10.1_Bin\bin\Debug\vtkverdict.lib
E:\itk\VTK5.10.1_Bin\bin\Debug\vtkDICOMParser.lib
E:\itk\VTK5.10.1_Bin\bin\Debug\vtkNetCDF_cxx.lib
E:\itk\VTK5.10.1_Bin\bin\Debug\LSDyna.lib
E:\itk\VTK5.10.1_Bin\bin\Debug\vtkmetaio.lib
comctl32.lib
E:\itk\VTK5.10.1_Bin\bin\Debug\vtksqlite.lib
E:\itk\VTK5.10.1_Bin\bin\Debug\vtkpng.lib
E:\itk\VTK5.10.1_Bin\bin\Debug\vtktiff.lib
E:\itk\VTK5.10.1_Bin\bin\Debug\vtkjpeg.lib
E:\itk\VTK5.10.1_Bin\bin\Debug\vtkexpat.lib
E:\itk\VTK5.10.1_Bin\bin\Debug\vtksys.lib
E:\itk\VTK5.10.1_Bin\bin\Debug\vtkftgl.lib
E:\itk\VTK5.10.1_Bin\bin\Debug\vtkfreetype.lib
opengl32.lib
E:\itk\VTK5.10.1_Bin\bin\Debug\vtkexoIIc.lib
E:\itk\VTK5.10.1_Bin\bin\Debug\vtkNetCDF.lib
E:\itk\VTK5.10.1_Bin\bin\Debug\vtkhdf5_hl.lib
E:\itk\VTK5.10.1_Bin\bin\Debug\vtkhdf5.lib
E:\itk\VTK5.10.1_Bin\bin\Debug\vtkzlib.lib
wsock32.lib
ws2_32.lib
vfw32.lib
E:\itk\InsightToolkit-4.3.1_Bin\lib\Debug\itkNetlibSlatec-4.3.lib
E:\itk\InsightToolkit-4.3.1_Bin\lib\Debug\ITKStatistics-4.3.lib
E:\itk\InsightToolkit-4.3.1_Bin\lib\Debug\ITKIOImageBase-4.3.lib
E:\itk\InsightToolkit-4.3.1_Bin\lib\Debug\ITKIOBMP-4.3.lib
E:\itk\InsightToolkit-4.3.1_Bin\lib\Debug\ITKIOBioRad-4.3.lib
E:\itk\InsightToolkit-4.3.1_Bin\lib\Debug\ITKEXPAT-4.3.lib
E:\itk\InsightToolkit-4.3.1_Bin\lib\Debug\itkopenjpeg-4.3.lib
E:\itk\InsightToolkit-4.3.1_Bin\lib\Debug\itkzlib-4.3.lib
E:\itk\InsightToolkit-4.3.1_Bin\lib\Debug\itkgdcmDICT-4.3.lib
E:\itk\InsightToolkit-4.3.1_Bin\lib\Debug\itkgdcmMSFF-4.3.lib
E:\itk\InsightToolkit-4.3.1_Bin\lib\Debug\ITKIOGDCM-4.3.lib
E:\itk\InsightToolkit-4.3.1_Bin\lib\Debug\ITKIOGIPL-4.3.lib
E:\itk\InsightToolkit-4.3.1_Bin\lib\Debug\itkjpeg-4.3.lib
E:\itk\InsightToolkit-4.3.1_Bin\lib\Debug\ITKIOJPEG-4.3.lib
E:\itk\InsightToolkit-4.3.1_Bin\lib\Debug\itktiff-4.3.lib
E:\itk\InsightToolkit-4.3.1_Bin\lib\Debug\ITKIOTIFF-4.3.lib
E:\itk\InsightToolkit-4.3.1_Bin\lib\Debug\ITKIOLSM-4.3.lib
E:\itk\InsightToolkit-4.3.1_Bin\lib\Debug\ITKMetaIO-4.3.lib
E:\itk\InsightToolkit-4.3.1_Bin\lib\Debug\ITKIOMeta-4.3.lib
E:\itk\InsightToolkit-4.3.1_Bin\lib\Debug\ITKznz-4.3.lib
E:\itk\InsightToolkit-4.3.1_Bin\lib\Debug\ITKniftiio-4.3.lib
E:\itk\InsightToolkit-4.3.1_Bin\lib\Debug\ITKIONIFTI-4.3.lib
E:\itk\InsightToolkit-4.3.1_Bin\lib\Debug\ITKNrrdIO-4.3.lib
E:\itk\InsightToolkit-4.3.1_Bin\lib\Debug\ITKIONRRD-4.3.lib
E:\itk\InsightToolkit-4.3.1_Bin\lib\Debug\itkpng-4.3.lib
E:\itk\InsightToolkit-4.3.1_Bin\lib\Debug\ITKIOPNG-4.3.lib
E:\itk\InsightToolkit-4.3.1_Bin\lib\Debug\ITKIOStimulate-4.3.lib
E:\itk\InsightToolkit-4.3.1_Bin\lib\Debug\ITKIOVTK-4.3.lib
E:\itk\InsightToolkit-4.3.1_Bin\lib\Debug\ITKMesh-4.3.lib
E:\itk\InsightToolkit-4.3.1_Bin\lib\Debug\ITKSpatialObjects-4.3.lib
E:\itk\InsightToolkit-4.3.1_Bin\lib\Debug\ITKPath-4.3.lib
E:\itk\InsightToolkit-4.3.1_Bin\lib\Debug\ITKLabelMap-4.3.lib
E:\itk\InsightToolkit-4.3.1_Bin\lib\Debug\ITKQuadEdgeMesh-4.3.lib
E:\itk\InsightToolkit-4.3.1_Bin\lib\Debug\ITKOptimizers-4.3.lib
E:\itk\InsightToolkit-4.3.1_Bin\lib\Debug\ITKPolynomials-4.3.lib
E:\itk\InsightToolkit-4.3.1_Bin\lib\Debug\ITKBiasCorrection-4.3.lib
E:\itk\InsightToolkit-4.3.1_Bin\lib\Debug\ITKBioCell-4.3.lib
E:\itk\InsightToolkit-4.3.1_Bin\lib\Debug\ITKDICOMParser-4.3.lib
E:\itk\InsightToolkit-4.3.1_Bin\lib\Debug\ITKIOXML-4.3.lib
E:\itk\InsightToolkit-4.3.1_Bin\lib\Debug\ITKIOSpatialObjects-4.3.lib
E:\itk\InsightToolkit-4.3.1_Bin\lib\Debug\ITKFEM-4.3.lib
E:\itk\InsightToolkit-4.3.1_Bin\lib\Debug\ITKgiftiio-4.3.lib
E:\itk\InsightToolkit-4.3.1_Bin\lib\Debug\ITKIOMesh-4.3.lib
E:\itk\InsightToolkit-4.3.1_Bin\lib\Debug\itkhdf5_cpp-4.3.lib
E:\itk\InsightToolkit-4.3.1_Bin\lib\Debug\itkhdf5-4.3.lib
E:\itk\InsightToolkit-4.3.1_Bin\lib\Debug\ITKIOCSV-4.3.lib
E:\itk\InsightToolkit-4.3.1_Bin\lib\Debug\ITKIOIPL-4.3.lib
E:\itk\InsightToolkit-4.3.1_Bin\lib\Debug\ITKIOGE-4.3.lib
E:\itk\InsightToolkit-4.3.1_Bin\lib\Debug\ITKIOSiemens-4.3.lib
E:\itk\InsightToolkit-4.3.1_Bin\lib\Debug\ITKIOHDF5-4.3.lib
E:\itk\InsightToolkit-4.3.1_Bin\lib\Debug\ITKIOTransformBase-4.3.lib
E:\itk\InsightToolkit-4.3.1_Bin\lib\Debug\ITKIOTransformHDF5-4.3.lib
E:\itk\InsightToolkit-4.3.1_Bin\lib\Debug\ITKIOTransformInsightLegacy-4.3.lib
E:\itk\InsightToolkit-4.3.1_Bin\lib\Debug\ITKIOTransformMatlab-4.3.lib
E:\itk\InsightToolkit-4.3.1_Bin\lib\Debug\ITKKLMRegionGrowing-4.3.lib
E:\itk\InsightToolkit-4.3.1_Bin\lib\Debug\ITKVTK-4.3.lib
E:\itk\InsightToolkit-4.3.1_Bin\lib\Debug\ITKWatersheds-4.3.lib
E:\itk\InsightToolkit-4.3.1_Bin\lib\Debug\ITKOptimizersv4-4.3.lib
E:\itk\InsightToolkit-4.3.1_Bin\lib\Debug\ITKReview-4.3.lib
E:\itk\InsightToolkit-4.3.1_Bin\lib\Debug\ITKVideoCore-4.3.lib
E:\itk\InsightToolkit-4.3.1_Bin\lib\Debug\ITKVideoIO-4.3.lib
E:\itk\InsightToolkit-4.3.1_Bin\lib\Debug\itkgdcmIOD-4.3.lib
E:\itk\InsightToolkit-4.3.1_Bin\lib\Debug\itkgdcmDSED-4.3.lib
E:\itk\InsightToolkit-4.3.1_Bin\lib\Debug\itkgdcmCommon-4.3.lib
E:\itk\InsightToolkit-4.3.1_Bin\lib\Debug\itkgdcmjpeg8-4.3.lib
E:\itk\InsightToolkit-4.3.1_Bin\lib\Debug\itkgdcmjpeg12-4.3.lib
E:\itk\InsightToolkit-4.3.1_Bin\lib\Debug\itkgdcmjpeg16-4.3.lib
rpcrt4.lib



编译完成后,可以正常显示一幅图像。ITK,VTK链接成功


你可能感兴趣的:(链接,ITK,VTK)