[Insight-users] Static Linking ITK libraries with Qt Creator's pro file configuration

Matt McCormick matt.mccormick at kitware.com
Mon May 6 21:08:43 EDT 2013


Hi chasank,

CMake is highly recommended with ITK/VTK/Qt/QtCreator.  See here, for example:

  http://doc.qt.digia.com/qtcreator-2.4/creator-project-cmake.html

HTH,
Matt

On Thu, May 2, 2013 at 5:44 PM, chasank <chasank at gmail.com> wrote:
> Hi all,
>
> I want to develop a hello world application on windows which uses
> vtk(5.10.1), itk(4.3.2) and Qt(4.8.4). For compiling and building process I
> don't want to use cmake. Because I don't want to develop the application on
> MS Visual Studio, Qt Creator is much better. The problem is itk's static
> libraries as you know ITK does not provide any DLL except ITKCommon-4.3 on
> windows platform. I could not manage to link libraries staticaly from
> project's .pro file. According to Qt Documentation PRE_TARGETDEPS flag is
> for static library linking however with the following .pro configuration, I
> get linker errors;
> What should I do? Thanks all from now.
>
> itksys-4.3.lib(SystemTools.obj) : error LNK2019: unresolved external symbol
> __imp__RegCloseKey at 4 referenced in function "public: static bool __cdecl
> itksys::SystemTools::ReadRegistryValue(char const *,class
> std::basic_string<char,struct std::char_traits&lt;char>,class
> std::allocator<char> > &,enum itksys::SystemTools::KeyWOW64)"
> (?ReadRegistryValue at SystemTools@itksys@@SA_NPBDAAV?$basic_string at DU?$char_traits at D@std@@V?$allocator at D@2@@std@@W4KeyWOW64 at 12@@Z)
> itksys-4.3.lib(SystemTools.obj) : error LNK2019: unresolved external symbol
> __imp__RegQueryValueExA at 24 referenced in function "public: static bool
> __cdecl itksys::SystemTools::ReadRegistryValue(char const *,class
> std::basic_string<char,struct std::char_traits&lt;char>,class
> std::allocator<char> > &,enum itksys::SystemTools::KeyWOW64)"
> (?ReadRegistryValue at SystemTools@itksys@@SA_NPBDAAV?$basic_string at DU?$char_traits at D@std@@V?$allocator at D@2@@std@@W4KeyWOW64 at 12@@Z)
> itksys-4.3.lib(SystemTools.obj) : error LNK2019: unresolved external symbol
> __imp__RegOpenKeyExA at 20 referenced in function "public: static bool __cdecl
> itksys::SystemTools::ReadRegistryValue(char const *,class
> std::basic_string<char,struct std::char_traits&lt;char>,class
> std::allocator<char> > &,enum itksys::SystemTools::KeyWOW64)"
> (?ReadRegistryValue at SystemTools@itksys@@SA_NPBDAAV?$basic_string at DU?$char_traits at D@std@@V?$allocator at D@2@@std@@W4KeyWOW64 at 12@@Z)
> itksys-4.3.lib(SystemTools.obj) : error LNK2019: unresolved external symbol
> __imp__RegSetValueExA at 24 referenced in function "public: static bool __cdecl
> itksys::SystemTools::WriteRegistryValue(char const *,char const *,enum
> itksys::SystemTools::KeyWOW64)"
> (?WriteRegistryValue at SystemTools@itksys@@SA_NPBD0W4KeyWOW64 at 12@@Z)
> itksys-4.3.lib(SystemTools.obj) : error LNK2019: unresolved external symbol
> __imp__RegCreateKeyExA at 36 referenced in function "public: static bool
> __cdecl itksys::SystemTools::WriteRegistryValue(char const *,char const
> *,enum itksys::SystemTools::KeyWOW64)"
> (?WriteRegistryValue at SystemTools@itksys@@SA_NPBD0W4KeyWOW64 at 12@@Z)
> itksys-4.3.lib(SystemTools.obj) : error LNK2019: unresolved external symbol
> __imp__RegDeleteValueA at 8 referenced in function "public: static bool __cdecl
> itksys::SystemTools::DeleteRegistryValue(char const *,enum
> itksys::SystemTools::KeyWOW64)"
> (?DeleteRegistryValue at SystemTools@itksys@@SA_NPBDW4KeyWOW64 at 12@@Z)
> release\VisibleHuman.exe : fatal error LNK1120: 6 unresolved externals
>
>
> .pro file
>
> QT       += core gui
>
> greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
>
> TARGET = VisibleHuman
> TEMPLATE = app
>
>
> SOURCES  += main.cpp\
>                    mainwindow.cpp \
>                    components.cpp
>
> HEADERS  += mainwindow.h \
>                    components.h
>
> FORMS     += mainwindow.ui
>
> win32: LIBS += -L$$PWD/../../../vtk/x86/5.10.1/install/lib/ -lLSDyna \
> -lMapReduceMPI \
> -lmpistubs \
> -lQVTK \
> -lvtkalglib \
> -lvtkCharts \
> -lvtkCommon \
> -lvtkDICOMParser \
> -lvtkexoIIc \
> -lvtkexpat \
> -lvtkFiltering \
> -lvtkfreetype \
> -lvtkftgl \
> -lvtkGenericFiltering \
> -lvtkGeovis \
> -lvtkGraphics \
> -lvtkhdf5 \
> -lvtkhdf5_hl \
> -lvtkHybrid \
> -lvtkImaging \
> -lvtkInfovis \
> -lvtkIO \
> -lvtkjpeg \
> -lvtklibxml2 \
> -lvtkmetaio \
> -lvtkNetCDF \
> -lvtkNetCDF_cxx \
> -lvtkpng \
> -lvtkproj4 \
> -lvtkRendering \
> -lvtksqlite \
> -lvtksys \
> -lvtktiff \
> -lvtkverdict \
> -lvtkViews \
> -lvtkVolumeRendering \
> -lvtkWidgets \
> -lvtkzlib
>
> INCLUDEPATH += $$PWD/../../../vtk/x86/5.10.1/install/include/vtk-5.10
> DEPENDPATH += $$PWD/../../../vtk/x86/5.10.1/install/include/vtk-5.10
>
>
> win32: LIBS += -L$$PWD/../../../itk/x86/4.3.2/install/lib/
> -lITKBiasCorrection-4.3 \
> -lITKBiasCorrection-4.3 \
> -lITKBioCell-4.3 \
> -lITKCommon-4.3 \
> -lITKDICOMParser-4.3 \
> -lITKEXPAT-4.3 \
> -lITKFEM-4.3 \
> -litkgdcmCommon-4.3 \
> -litkgdcmDICT-4.3 \
> -litkgdcmDSED-4.3 \
> -litkgdcmIOD-4.3 \
> -litkgdcmjpeg8-4.3 \
> -litkgdcmjpeg12-4.3 \
> -litkgdcmjpeg16-4.3 \
> -litkgdcmMSFF-4.3 \
> -lITKgiftiio-4.3 \
> -litkhdf5_cpp-4.3 \
> -litkhdf5-4.3 \
> -lITKIOBioRad-4.3 \
> -lITKIOBMP-4.3 \
> -lITKIOCSV-4.3 \
> -lITKIOGDCM-4.3 \
> -lITKIOGE-4.3 \
> -lITKIOGIPL-4.3 \
> -lITKIOHDF5-4.3 \
> -lITKIOImageBase-4.3 \
> -lITKIOIPL-4.3 \
> -lITKIOJPEG-4.3 \
> -lITKIOLSM-4.3 \
> -lITKIOMesh-4.3 \
> -lITKIOMeta-4.3 \
> -lITKIONIFTI-4.3 \
> -lITKIONRRD-4.3 \
> -lITKIOPNG-4.3 \
> -lITKIOSiemens-4.3 \
> -lITKIOSpatialObjects-4.3 \
> -lITKIOStimulate-4.3 \
> -lITKIOTIFF-4.3 \
> -lITKIOTransformBase-4.3 \
> -lITKIOTransformHDF5-4.3 \
> -lITKIOTransformInsightLegacy-4.3 \
> -lITKIOTransformMatlab-4.3 \
> -lITKIOVTK-4.3 \
> -lITKIOXML-4.3 \
> -litkjpeg-4.3 \
> -lITKKLMRegionGrowing-4.3 \
> -lITKLabelMap-4.3 \
> -lITKMesh-4.3 \
> -lITKMetaIO-4.3 \
> -litkNetlibSlatec-4.3 \
> -lITKniftiio-4.3 \
> -lITKNrrdIO-4.3 \
> -litkopenjpeg-4.3 \
> -lITKOptimizers-4.3 \
> -lITKOptimizersv4-4.3 \
> -lITKPath-4.3 \
> -litkpng-4.3 \
> -lITKPolynomials-4.3 \
> -lITKQuadEdgeMesh-4.3 \
> -lITKReview-4.3 \
> -lITKSpatialObjects-4.3 \
> -lITKStatistics-4.3 \
> -litksys-4.3 \
> -litktiff-4.3 \
> -litkv3p_lsqr-4.3 \
> -litkv3p_netlib-4.3 \
> -litkvcl-4.3 \
> -lITKVideoCore-4.3 \
> -lITKVideoIO-4.3 \
> -litkvnl_algo-4.3 \
> -litkvnl-4.3 \
> -lITKVNLInstantiation-4.3 \
> -lITKVTK-4.3 \
> -lITKVtkGlue-4.3 \
> -lITKWatersheds-4.3 \
> -litkzlib-4.3 \
> -lITKznz-4.3
>
> INCLUDEPATH += $$PWD/../../../itk/x86/4.3.2/install/include/ITK-4.3
> DEPENDPATH += $$PWD/../../../itk/x86/4.3.2/install/include/ITK-4.3
>
> win32: PRE_TARGETDEPS +=
> $$PWD/../../../itk/x86/4.3.2/install/lib/itksys-4.3.lib
>
>
>
> --
> View this message in context: http://itk-users.7.n7.nabble.com/Static-Linking-ITK-libraries-with-Qt-Creator-s-pro-file-configuration-tp31337.html
> Sent from the ITK - Users mailing list archive at Nabble.com.
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Kitware offers ITK Training Courses, for more information visit:
> http://www.kitware.com/products/protraining.php
>
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-users


More information about the Insight-users mailing list