Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. 3rd Party Software
  4. Error while link libraries between Qt and ITK.
Forum Updated to NodeBB v4.3 + New Features

Error while link libraries between Qt and ITK.

Scheduled Pinned Locked Moved Unsolved 3rd Party Software
5 Posts 3 Posters 684 Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    Deepak Murali
    wrote on last edited by Deepak Murali
    #1

    Hai all,

    I want to develop a image processing and visualization software. So i tried to integrate vtk and itk to qt. Unfortunately there is an error occurred while link libraries of itk to Qt. the error is "itksys-4.13.lib(SystemTools.obj):-1: error: LNK2019: unresolved external symbol". But the lib itksys-4.3 is exist in the pro file. The complete error given below.

    itksys-4.13.lib(SystemTools.obj):-1: error: 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)
    

    And also the qt pro file details given below.

    QT       += core gui
    
    greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
    
    CONFIG += c++11
    
    # The following define makes your compiler emit warnings if you use
    # any Qt feature that has been marked deprecated (the exact warnings
    # depend on your compiler). Please consult the documentation of the
    # deprecated API in order to know how to port your code away from it.
    DEFINES += QT_DEPRECATED_WARNINGS
    
    # You can also make your code fail to compile if it uses deprecated APIs.
    # In order to do so, uncomment the following line.
    # You can also select to disable deprecated APIs only up to a certain version of Qt.
    #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs deprecated before Qt 6.0.0
    
    SOURCES += \
        main.cpp \
        widget.cpp
    
    HEADERS += \
        widget.h
    
    FORMS += \
        widget.ui
    
    win32 {
        INCLUDEPATH += $$quote("C:/Program Files/ITK/include/ITK-4.13")
    
    DEPENDPATH += "C:/Program Files/ITK/include/ITK-4.13"
        CONFIG(debug, debug|release ) {
            # debug
        } else {
            # release
            QMAKE_LIBDIR += "C:/Program Files/ITK/lib"
    
            LIBS += -lITKBiasCorrection-4.13\
    -lITKBioCell-4.13\
    -lITKCommon-4.13\
    -lITKDICOMParser-4.13\
    -litkdouble-conversion-4.13\
    -lITKEXPAT-4.13\
    -lITKFEM-4.13\
    -litkgdcmcharls-4.13\
    -litkgdcmCommon-4.13\
    -litkgdcmDICT-4.13\
    -litkgdcmDSED-4.13\
    -litkgdcmIOD-4.13\
    -litkgdcmjpeg8-4.13\
    -litkgdcmjpeg12-4.13\
    -litkgdcmjpeg16-4.13\
    -litkgdcmMEXD-4.13\
    -litkgdcmMSFF-4.13\
    -litkgdcmopenjp2-4.13\
    -litkgdcmsocketxx-4.13\
    -lITKgiftiio-4.13\
    -lITKIOBioRad-4.13\
    -lITKIOBMP-4.13\
    -lITKIOBruker-4.13\
    -lITKIOCSV-4.13\
    -lITKIOGDCM-4.13\
    -lITKIOGE-4.13\
    -lITKIOGIPL-4.13\
    -lITKIOHDF5-4.13\
    -lITKIOImageBase-4.13\
    -lITKIOIPL-4.13\
    -lITKIOJPEG-4.13\
    -lITKIOLSM-4.13\
    -lITKIOMesh-4.13\
    -lITKIOMeta-4.13\
    -lITKIOMINC-4.13\
    -lITKIOMRC-4.13\
    -lITKIONIFTI-4.13\
    -lITKIONRRD-4.13\
    -lITKIOPNG-4.13\
    -lITKIOSiemens-4.13\
    -lITKIOSpatialObjects-4.13\
    -lITKIOStimulate-4.13\
    -lITKIOTIFF-4.13\
    -lITKIOTransformBase-4.13\
    -lITKIOTransformHDF5-4.13\
    -lITKIOTransformInsightLegacy-4.13\
    -lITKIOTransformMatlab-4.13\
    -lITKIOVTK-4.13\
    -lITKIOXML-4.13\
    -litkjpeg-4.13\
    -lITKKLMRegionGrowing-4.13\
    -lITKLabelMap-4.13\
    -litklbfgs-4.13\
    -lITKMesh-4.13\
    -lITKMetaIO-4.13\
    -litkminc2-4.13\
    -litknetlib-4.13\
    -litkNetlibSlatec-4.13\
    -lITKniftiio-4.13\
    -lITKNrrdIO-4.13\
    -lITKOptimizers-4.13\
    -lITKOptimizersv4-4.13\
    -lITKPath-4.13\
    -litkpng-4.13\
    -lITKPolynomials-4.13\
    -lITKQuadEdgeMesh-4.13\
    -lITKSpatialObjects-4.13\
    -lITKStatistics-4.13\
    -litksys-4.13\
    -litktestlib-4.13\
    -litktiff-4.13\
    -lITKTransform-4.13\
    -lITKTransformFactory-4.13\
    -litkv3p_netlib-4.13\
    -litkvcl-4.13\
    -lITKVideoCore-4.13\
    -lITKVideoIO-4.13\
    -litkvnl_algo-4.13\
    -litkvnl-4.13\
    -lITKVNLInstantiation-4.13\
    -lITKVTK-4.13\
    -lITKVtkGlue-4.13\
    -lITKWatersheds-4.13\
    -litkzlib-4.13\
    -lITKznz-4.13\
    -llibitkhdf5\
    -llibitkhdf5_cpp
    
        }
    }
    
    # Default rules for deployment.
    qnx: target.path = /tmp/$${TARGET}/bin
    else: unix:!android: target.path = /opt/$${TARGET}/bin
    !isEmpty(target.path): INSTALLS += target
    
    

    I tried many ways to sort out the issue. But still it exist. Any body please help me to sort out the issues.

    Thanks in advance

    Deepak Murali

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      Did you check that the libraries are from the right architecture ?

      Which compiler are you using ?
      Which compiler was used to build itk ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      D 1 Reply Last reply
      0
      • SGaistS SGaist

        Hi and welcome to devnet,

        Did you check that the libraries are from the right architecture ?

        Which compiler are you using ?
        Which compiler was used to build itk ?

        D Offline
        D Offline
        Deepak Murali
        wrote on last edited by
        #3

        @SGaist yes i checked. msvc 2015 64bit. the same i used to build itk.

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Did you check the linker output ? Does it contain the required library ?

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • M Offline
            M Offline
            mchinand
            wrote on last edited by mchinand
            #5

            ITK is much easier to work with if you use CMake instead of qmake .pro project files. Your link command is missing a library that would have been automatically added to the linking if you used CMake.

            1 Reply Last reply
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved