[ITK Community] [Insight-users] Hello ITK with Qt Creator issue

Barbara Post bpo at eonix.be
Fri Mar 7 03:41:31 EST 2014


Hi Alok,

Finally we decided to go with CMake and left the idea of working with QMake format, since CMake is more widespread and powerful.

Idea was to use itkImage and some ITK filter such as http://www.itk.org/Doxygen/html/classitk_1_1AdaptiveHistogramEqualizationImageFilter.html

But the Hello World just tests linkage is correct. So here are the files, anyways.

QMake file : http://pastebin.com/UwfGEqNs (I define « ITK » environment variable as my installation directory)

CMake file : http://pastebin.com/g3yjy8is works perfectly but I wonder why it detected ITK in my build directory rather than installation one since I have boths on my machine. I can see this in project files tree in Qt Creator.

main.cpp : http://pastebin.com/Y9MvdK1s

Have a nice day,
--
Barbara POST

From: Alok [mailto:alok.theanomaly at gmail.com]
Sent: jeudi 6 mars 2014 16:17
To: Barbara Post
Cc: insight-users at itk.org
Subject: Re: [ITK Community] [Insight-users] Hello ITK with Qt Creator issue

Hi Barbara,

In my opinion getting a Hello World running ITK should not need linking to too many libraries.
Can you share your current source(.cpp) and Qmake/Cmake file?

Alok

On Thu, Mar 6, 2014 at 3:01 AM, Barbara Post <bpo at eonix.be<mailto:bpo at eonix.be>> wrote:
Hello again,

Yesterday I went back to my ITK Hello World project based on QMake. I checked libs linkages because my compilation issue is about linkage. I have the following issue: in the QMake project file below I have linkage to ITKBiasCorrection library, as Jothy gave me a list of libs to link against. But in my build/install tree I cannot find neither the header nor the lib matching  ITKBiasCorrection. So my CMake options were incomplete. ITKBioCell exists, however.

Here is my CMake configuration, using CMake-GUI I went to advanced mode.

-          ITK_BUILD_DEFAULT_MODULES: checked

-          Module_ItkVtkGlue: checked

So I clearly miss something to get ITKBiasCorrection build.
Since list of libs is lengthy and I really don't know much, what's your best advice to get a rich but not obese ITK build?

Do you think the following list is a minimal set of required libs?

I'm going to search now for build options but your input is welcome.

ITKBiasCorrection-4.5
ITKBioCell-4.5
ITKCommon-4.5
ITKDICOMParser-4.5
itkdouble-conversion-4.5
ITKEXPAT-4.5
ITKFEM-4.5
itkgdcmCommon-4.5
itkgdcmDICT-4.5
itkgdcmDSED-4.5\
itkgdcmIOD-4.5
itkgdcmjpeg8-4.5
itkgdcmjpeg12-4.5
itkgdcmjpeg16-4.5
itkgdcmMSFF-4.5
ITKgiftiio-4.5
itkhdf5_cpp-4.5
itkhdf5-4.5
ITKIOBioRad-4.5
ITKIOBMP-4.5\
ITKIOCSV-4.5
ITKIOGDCM-4.5
ITKIOGE-4.5
ITKIOGIPL-4.5
ITKIOHDF5-4.5
ITKIOImageBase-4.5
ITKIOIPL-4.5
ITKIOJPEG-4.5
ITKIOLSM-4.5
ITKIOMesh-4.5
ITKIOMeta-4.5
ITKIOMRC-4.5\
ITKIONIFTI-4.5
ITKIONRRD-4.5
ITKIOPNG-4.5
ITKIOSiemens-4.5
ITKIOSpatialObjects-4.5
ITKIOStimulate-4.5
ITKIOTIFF-4.5
ITKIOTransformBase-4.5
ITKIOTransformHDF5-4.5
ITKIOTransformInsightLegacy-4.5\
ITKIOTransformMatlab-4.5
ITKIOVTK-4.5
ITKIOXML-4.5
itkjpeg-4.5
ITKKLMRegionGrowing-4.5
ITKLabelMap-4.5
ITKMesh-4.5
ITKMetaIO-4.5
itkNetlibSlatec-4.5
ITKniftiio-4.5\
ITKNrrdIO-4.5
itkopenjpeg-4.5
ITKOptimizers-4.5
ITKPath-4.5
itkpng-4.5
ITKPolynomials-4.5
ITKQuadEdgeMesh-4.5
ITKSpatialObjects-4.5
ITKStatistics-4.5\
itktiff-4.5
itkv3p_lsqr-4.5
itkv3p_netlib-4.5
itkvcl-4.5
ITKVideoCore-4.5
ITKVideoIO-4.5
itkvnl_algo-4.5
itkvnl-4.5
ITKVNLInstantiation-4.5
ITKVTK-4.5\
ITKVtkGlue-4.5
ITKWatersheds-4.5
itkzlib-4.5
ITKznz-4.5
--
Barbara POST

From: Insight-users [mailto:insight-users-bounces at itk.org<mailto:insight-users-bounces at itk.org>] On Behalf Of Barbara Post
Sent: vendredi 28 février 2014 11:34
To: insight-users at itk.org<mailto:insight-users at itk.org>
Subject: Re: [Insight-users] Hello ITK with Qt Creator issue

Hello again,

After compiling VTK, ITK with vtkGlue enabled, I still have troubles when using ITK in a QMake project.

Now the error changed to this one, surprisingly:

ITKCommon-4.5.lib(itkDynamicLoader.obj):-1: error: LNK2019: unresolved external symbol "public: static struct HINSTANCE__ * __cdecl itksys::DynamicLoader::OpenLibrary(char const *)" (?OpenLibrary at DynamicLoader@itksys@@SAPEAUHINSTANCE__@@PEBD at Z) referenced in function "public: static struct HINSTANCE__ * __cdecl itk::DynamicLoader::OpenLibrary(char const *)" (?OpenLibrary at DynamicLoader@itk@@SAPEAUHINSTANCE__@@PEBD at 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.

Almost going to give up in favor of CMake project :-) so this is my last call to feedback about people who used a QMake project.

Thanks,

--
Barbara POST


_____________________________________
Powered by www.kitware.com<http://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

_______________________________________________
Community mailing list
Community at itk.org<mailto:Community at itk.org>
http://public.kitware.com/cgi-bin/mailman/listinfo/community



--
I live a simple life...  in 0s and 1s !
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/community/attachments/20140307/89ebf477/attachment-0002.html>
-------------- next part --------------
_____________________________________
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 Community mailing list