0

我已经使用 CMAKE 和 Visual Studio 2013 构建了 ITK 4.10,但我在 QtCreator 上使用它。我已按照此链接编写 .pro 文件。它工作得很好,除了一点。当我包含 itkImageFileReader.h 时,我收到 11 个 LNK2019 错误(其他 .h 文件没有问题)。这里有一些 rapscallions:

itksys-4.10.lib(SystemTools.obj):-1: erreur : LNK2019: unresolved external symbol __imp_OpenProcessToken referenced in function "bool __cdecl itksys::DeleteJunction(class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > const &)" (?DeleteJunction@itksys@@YA_NAEBV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@@Z)

itksys-4.10.lib(SystemTools.obj):-1: erreur : LNK2019: unresolved external symbol __imp_AdjustTokenPrivileges referenced in function "bool __cdecl itksys::DeleteJunction(class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > const &)" (?DeleteJunction@itksys@@YA_NAEBV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@@Z)

itksys-4.10.lib(EncodingCXX.obj):-1: erreur : LNK2019: unresolved external symbol __imp_CommandLineToArgvW referenced in function "public: static class itksys::Encoding::CommandLineArguments __cdecl itksys::Encoding::CommandLineArguments::Main(int,char const * const *)" (?Main@CommandLineArguments@Encoding@itksys@@SA?AV123@HPEBQEBD@Z)

它找不到itksys-4.10.lib(SystemTools.obj) 和(EncodingCXX.obj)。

这是 .pro 文件:

QT += core
QT -= gui

CONFIG += c++11
TARGET = itkTest

CONFIG += console
CONFIG -= app_bundle

TEMPLATE = app

INCLUDEPATH += C:/InsightToolkit-4.10.0/include/ITK-4.10

LIBS += -LC:/InsightToolkit-4.10.0/build/lib/Release
LIBS += "C:/InsightToolkit-4.10.0/build/lib/Release/ITKBiasCorrection-4.10.lib" \
"C:/InsightToolkit-4.10.0/build/lib/Release/ITKBioCell-4.10.lib" \
"C:/InsightToolkit-4.10.0/build/lib/Release/ITKCommon-4.10.lib" \
"C:/InsightToolkit-4.10.0/build/lib/Release/ITKDICOMParser-4.10.lib" \
"C:/InsightToolkit-4.10.0/build/lib/Release/itkdouble-conversion-4.10.lib" \
"C:/InsightToolkit-4.10.0/build/lib/Release/ITKEXPAT-4.10.lib" \
"C:/InsightToolkit-4.10.0/build/lib/Release/ITKFEM-4.10.lib" \
"C:/InsightToolkit-4.10.0/build/lib/Release/itkgdcmcharls-4.10.lib" \
"C:/InsightToolkit-4.10.0/build/lib/Release/itkgdcmCommon-4.10.lib" \
"C:/InsightToolkit-4.10.0/build/lib/Release/itkgdcmDICT-4.10.lib" \
"C:/InsightToolkit-4.10.0/build/lib/Release/itkgdcmDSED-4.10.lib" \
"C:/InsightToolkit-4.10.0/build/lib/Release/itkgdcmIOD-4.10.lib" \
"C:/InsightToolkit-4.10.0/build/lib/Release/itkgdcmjpeg8-4.10.lib" \
"C:/InsightToolkit-4.10.0/build/lib/Release/itkgdcmjpeg12-4.10.lib" \
"C:/InsightToolkit-4.10.0/build/lib/Release/itkgdcmjpeg16-4.10.lib" \
"C:/InsightToolkit-4.10.0/build/lib/Release/itkgdcmMEXD-4.10.lib" \
"C:/InsightToolkit-4.10.0/build/lib/Release/itkgdcmMSFF-4.10.lib" \
"C:/InsightToolkit-4.10.0/build/lib/Release/itkgdcmopenjpeg-4.10.lib" \
"C:/InsightToolkit-4.10.0/build/lib/Release/itkgdcmsocketxx-4.10.lib" \
"C:/InsightToolkit-4.10.0/build/lib/Release/ITKgiftiio-4.10.lib" \
"C:/InsightToolkit-4.10.0/build/lib/Release/itkhdf5_cpp-4.10.lib" \
"C:/InsightToolkit-4.10.0/build/lib/Release/itkhdf5-4.10.lib" \
"C:/InsightToolkit-4.10.0/build/lib/Release/ITKIOBioRad-4.10.lib" \
"C:/InsightToolkit-4.10.0/build/lib/Release/ITKIOBMP-4.10.lib" \
"C:/InsightToolkit-4.10.0/build/lib/Release/ITKIOCSV-4.10.lib" \
"C:/InsightToolkit-4.10.0/build/lib/Release/ITKIOGDCM-4.10.lib" \
"C:/InsightToolkit-4.10.0/build/lib/Release/ITKIOGE-4.10.lib" \
"C:/InsightToolkit-4.10.0/build/lib/Release/ITKIOGIPL-4.10.lib" \
"C:/InsightToolkit-4.10.0/build/lib/Release/ITKIOHDF5-4.10.lib" \
"C:/InsightToolkit-4.10.0/build/lib/Release/ITKIOImageBase-4.10.lib" \
"C:/InsightToolkit-4.10.0/build/lib/Release/ITKIOIPL-4.10.lib" \
"C:/InsightToolkit-4.10.0/build/lib/Release/ITKIOJPEG-4.10.lib" \
"C:/InsightToolkit-4.10.0/build/lib/Release/ITKIOLSM-4.10.lib" \
"C:/InsightToolkit-4.10.0/build/lib/Release/ITKIOMesh-4.10.lib" \
"C:/InsightToolkit-4.10.0/build/lib/Release/ITKIOMeta-4.10.lib" \
"C:/InsightToolkit-4.10.0/build/lib/Release/ITKIOMRC-4.10.lib" \
"C:/InsightToolkit-4.10.0/build/lib/Release/ITKIONIFTI-4.10.lib" \
"C:/InsightToolkit-4.10.0/build/lib/Release/ITKIONRRD-4.10.lib" \
"C:/InsightToolkit-4.10.0/build/lib/Release/ITKIOPNG-4.10.lib" \
"C:/InsightToolkit-4.10.0/build/lib/Release/ITKIOSiemens-4.10.lib" \
"C:/InsightToolkit-4.10.0/build/lib/Release/ITKIOSpatialObjects-4.10.lib" \
"C:/InsightToolkit-4.10.0/build/lib/Release/ITKIOStimulate-4.10.lib" \
"C:/InsightToolkit-4.10.0/build/lib/Release/ITKIOTIFF-4.10.lib" \
"C:/InsightToolkit-4.10.0/build/lib/Release/ITKIOTransformBase-4.10.lib" \
"C:/InsightToolkit-4.10.0/build/lib/Release/ITKIOTransformHDF5-4.10.lib" \
"C:/InsightToolkit-4.10.0/build/lib/Release/ITKIOTransformInsightLegacy-4.10.lib" \
"C:/InsightToolkit-4.10.0/build/lib/Release/ITKIOTransformMatlab-4.10.lib" \
"C:/InsightToolkit-4.10.0/build/lib/Release/ITKIOVTK-4.10.lib" \
"C:/InsightToolkit-4.10.0/build/lib/Release/ITKIOXML-4.10.lib" \
"C:/InsightToolkit-4.10.0/build/lib/Release/itkjpeg-4.10.lib" \
"C:/InsightToolkit-4.10.0/build/lib/Release/ITKKLMRegionGrowing-4.10.lib" \
"C:/InsightToolkit-4.10.0/build/lib/Release/ITKLabelMap-4.10.lib" \
"C:/InsightToolkit-4.10.0/build/lib/Release/ITKMesh-4.10.lib" \
"C:/InsightToolkit-4.10.0/build/lib/Release/ITKMetaIO-4.10.lib" \
"C:/InsightToolkit-4.10.0/build/lib/Release/itknetlib-4.10.lib" \
"C:/InsightToolkit-4.10.0/build/lib/Release/itkNetlibSlatec-4.10.lib" \
"C:/InsightToolkit-4.10.0/build/lib/Release/ITKniftiio-4.10.lib" \
"C:/InsightToolkit-4.10.0/build/lib/Release/ITKNrrdIO-4.10.lib" \
"C:/InsightToolkit-4.10.0/build/lib/Release/ITKOptimizers-4.10.lib" \
"C:/InsightToolkit-4.10.0/build/lib/Release/ITKOptimizersv4-4.10.lib" \
"C:/InsightToolkit-4.10.0/build/lib/Release/ITKPath-4.10.lib" \
"C:/InsightToolkit-4.10.0/build/lib/Release/itkpng-4.10.lib" \
"C:/InsightToolkit-4.10.0/build/lib/Release/ITKPolynomials-4.10.lib" \
"C:/InsightToolkit-4.10.0/build/lib/Release/ITKQuadEdgeMesh-4.10.lib" \
"C:/InsightToolkit-4.10.0/build/lib/Release/ITKSpatialObjects-4.10.lib" \
"C:/InsightToolkit-4.10.0/build/lib/Release/ITKStatistics-4.10.lib" \
"C:/InsightToolkit-4.10.0/build/lib/Release/itksys-4.10.lib" \
"C:/InsightToolkit-4.10.0/build/lib/Release/itktestlib-4.10.lib" \
"C:/InsightToolkit-4.10.0/build/lib/Release/itktiff-4.10.lib" \
"C:/InsightToolkit-4.10.0/build/lib/Release/ITKTransform-4.10.lib" \
"C:/InsightToolkit-4.10.0/build/lib/Release/itkv3p_netlib-4.10.lib" \
"C:/InsightToolkit-4.10.0/build/lib/Release/itkvcl-4.10.lib" \
"C:/InsightToolkit-4.10.0/build/lib/Release/ITKVideoCore-4.10.lib" \
"C:/InsightToolkit-4.10.0/build/lib/Release/ITKVideoIO-4.10.lib" \
"C:/InsightToolkit-4.10.0/build/lib/Release/itkvnl_algo-4.10.lib" \
"C:/InsightToolkit-4.10.0/build/lib/Release/itkvnl-4.10.lib" \
"C:/InsightToolkit-4.10.0/build/lib/Release/ITKVNLInstantiation-4.10.lib" \
"C:/InsightToolkit-4.10.0/build/lib/Release/ITKVTK-4.10.lib" \
"C:/InsightToolkit-4.10.0/build/lib/Release/ITKWatersheds-4.10.lib" \
"C:/InsightToolkit-4.10.0/build/lib/Release/itkzlib-4.10.lib" \
"C:/InsightToolkit-4.10.0/build/lib/Release/ITKznz-4.10.lib"

SOURCES += main.cpp

我尝试重建,但没有任何改变。你有解决这个问题的想法吗?

谢谢 !

约翰

4

1 回答 1

0

对于使用自定义 Visual Studio 项目的构建,我遇到了类似的问题。缺少一些 Windows 标准库。对于itkImageFileReader,您需要Advapi32.libShell32.lib

在我的 Visual Studio 项目中,未在 Linker->Input->Additional Dependencies 中检查从父级或项目默认值继承。

于 2017-03-17T08:54:26.130 回答