0

我正在开发 QT 中的应用程序,基于几个现有工具的组合,例如:ITK、VTK、DCMTK 和 SoQT(以及其他......)。

我正在尝试编译这整个混乱,经过几次尝试,我忍不住得到了这个错误:


Undefined symbols for architecture x86_64:
  "vtkPolyDataReader::New()", referenced from:
      ModelBuildingControl::extractProfileModels(unsigned int)in ModelBuildingControl.cpp.o
      ModelBuildingControl::loadModel()      in ModelBuildingControl.cpp.o
      vtkPolydata2Points::vtkPolydata2Points()in vtkPolydata2Points.cpp.o
      vtkPolydata2Points::vtkPolydata2Points()in vtkPolydata2Points.cpp.o
  "vtkPolyDataReader::GetOutput()", referenced from:
      ModelBuildingControl::extractProfileModels(unsigned int)in ModelBuildingControl.cpp.o
      vtkPolydata2Points::readSurfaceFromFile(std::basic_string<char, std::char_traits<char>, std::allocator<char> >)in vtkPolydata2Points.cpp.o
  "vtkPolyDataReader::SetOutput(vtkPolyData*)", referenced from:
      ModelBuildingControl::loadModel()      in ModelBuildingControl.cpp.o
  "vtkStructuredPointsReader::New()", referenced from:
      ModelBuildingControl::transformVolume()       in ModelBuildingControl.cpp.o
      ModelBuildingControl::transformAtlasInNaturalCOS(QString, QString) in ModelBuildingControl.cpp.o
      ModelBuildingControl::landmarkDist()       in ModelBuildingControl.cpp.o
  "vtkStructuredPointsReader::GetOutput()", referenced from:
      ModelBuildingControl::transformVolume()       in ModelBuildingControl.cpp.o
      ModelBuildingControl::transformAtlasInNaturalCOS(QString, QString) in ModelBuildingControl.cpp.o
  "vtkStructuredPointsWriter::New()", referenced from:
      ModelBuildingControl::transformVolume()       in ModelBuildingControl.cpp.o
      ModelBuildingControl::transformAtlasInNaturalCOS(QString, QString) in ModelBuildingControl.cpp.o
      ModelBuildingControl::buildAtlas()       in ModelBuildingControl.cpp.o
      ModelBuildingControl::exportPatientVolumes()       in ModelBuildingControl.cpp.o
  "vtkWriter::SetInput(vtkDataObject*)", referenced from:
      ModelBuildingControl::transformVolume()       in ModelBuildingControl.cpp.o
      ModelBuildingControl::transformAtlasInNaturalCOS(QString, QString) in ModelBuildingControl.cpp.o
      ModelBuildingControl::warpLensAtlasIntoPatients(std::basic_ofstream<char, std::char_traits<char> >&, vtkPolyData*, QString)in ModelBuildingControl.cpp.o
      ModelBuildingControl::warpScleraAtlasIntoPatients(std::basic_ofstream<char, std::char_traits<char> >&, vtkPolyData*, QString)in ModelBuildingControl.cpp.o
      ModelBuildingControl::landmarkDist()       in ModelBuildingControl.cpp.o
      ModelBuildingControl::buildAtlas()       in ModelBuildingControl.cpp.o
      ModelBuildingControl::exportPatientVolumes()       in ModelBuildingControl.cpp.o
      ...
  "vtkPolyDataWriter::New()", referenced from:
      ModelBuildingControl::warpLensAtlasIntoPatients(std::basic_ofstream<char, std::char_traits<char> >&, vtkPolyData*, QString)in ModelBuildingControl.cpp.o
      ModelBuildingControl::warpScleraAtlasIntoPatients(std::basic_ofstream<char, std::char_traits<char> >&, vtkPolyData*, QString)in ModelBuildingControl.cpp.o
      ModelBuildingControl::landmarkDist()       in ModelBuildingControl.cpp.o
      Points2vtkPolydata::Points2vtkPolydata()in Points2vtkPolydata.cpp.o
      Points2vtkPolydata::Points2vtkPolydata()in Points2vtkPolydata.cpp.o
  "vtkStructuredPointsReader::SetOutput(vtkStructuredPoints*)", referenced from:
      ModelBuildingControl::landmarkDist()       in ModelBuildingControl.cpp.o
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status

关于我正在使用的软件版本,它们是:ITK:4.3.1 VTK:5.10.1 SoQT:1.5.1 DCMTK:3.6.1(2012-11-02的快照)

到目前为止,我认为该错误与库 VTK 库的动态和静态链接有关,因为程序正在寻找的所有文件都已经存在!

您为解决我的问题提供的任何启发都将受到欢迎!

提前致谢!

4

1 回答 1

0

看起来您没有链接到像 vtkIO 这样的一些 vtk 库。在 CMake 中,您可以通过将 ${VTK_LIBRARIES} 添加到您正在编译的应用程序的 TARGET_LINK_LIBRARIES() 来避免指定每个 vtk 库。

于 2013-02-12T18:18:53.360 回答