Using ITK in Qt Creator issue



  • Hello,

    I've searched here and there, followed suggstion on itk-users mailing list but itkImage.h header is still not found.

    I compiled and installed latest ITK (4.5.1), using MSVC 2010 64bit compiler. I created a plain C++ project and copied code for ITK Hello World program.

    Thanks for your help.

    Qt Creator project file: http://pastebin.com/3pGLjbNw

    main.cpp : http://pastebin.com/9kzp3tkd

    Compilation result : http://pastebin.com/BUpt1pK3


  • Lifetime Qt Champion

    Hi,

    Maybe a stupid question but: is itkImage.h really in C:/ITK/include/ITK-4.5 and not in a further subdirectory ?



  • Well, before giving up and switch to CMakeLists.txt format...

    After compiling VTK, ITK with vtkGlue enabled, I still have troubles, and yes file is where stated, SGaist.

    @ITKCommon-4.5.lib(itkDynamicLoader.obj):-1: error: LNK2019: unresolved external symbol "public: static struct HINSTANCE__ * cdecl itksys::DynamicLoader::OpenLibrary(char const *)" (?OpenLibrary@DynamicLoader@itksys@@SAPEAUHINSTANCE@@PEBD@Z) referenced in function "public: static struct HINSTANCE__ * cdecl itk::DynamicLoader::OpenLibrary(char const *)" (?OpenLibrary@DynamicLoader@itk@@SAPEAUHINSTANCE@@PEBD@Z)@

    File not found: ITKCommon-4.5.lib(itkDynamicLoader.obj)

    It’s really strange because I didn’t modify the directories paths and the files are there as expected.

    My .pro file, again:

    @

    Pass information to Qmake (include path)

    INCLUDEPATH += $$PWD/../../../../../../ITK/include/ITK-4.5
    DEPENDPATH += $$PWD/../../../../../../ITK/include/ITK-4.5

    Pass information to Qmake (lib path)

    #QMAKE_LIBDIR += \

    $${ITK_LIBS}

    #C:/ITK/lib

    Pass information to Qmake (link against)

    win32: LIBS += -L$$PWD/../../../../../../ITK/lib/
    -lITKBiasCorrection-4.5
    -lITKBioCell-4.5
    -lITKCommon-4.5
    [… list of libs]
    @

    My ITK folder is in C:
    $$PWD shoud refer to C:\Dev\Projects\MyProject\HelloItk\qmake\HelloItk folder where I have the .pro file.
    So why are there 6 “../” instructions in path to climb up, rather than 5 ones ? If I put only 5 “../”, it won’t find itkImage.h.

    I guess I have libs references not in correct order.


  • Lifetime Qt Champion

    Hi,

    Something's not clear, do you have both symbols and library not found ? Or only symbols ?

    Also, you should rather give the absolute path to ITK rather than relative, it will be cleaner and you'll be sure to point to the correct folders



  • I may give a new try soon, will keep you posted.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.