[Insight-users] ITK+QT

David Doria daviddoria at gmail.com
Thu Sep 27 09:52:45 EDT 2012


On Thu, Sep 27, 2012 at 9:46 AM, fabiola <fabiola.fischer.F at gmail.com>wrote:

> Hello,
>
> I am sorry barging in with a silly question, but I am really stuck in the
> beginning: to compile an ITK example (DicomSeriesReadImageWrite2) in QT.
> I am using: Ubuntu 12.04, QT Creator 2.5.2 and ITK 4.2.
>
> I added ITK libraries to .pro like I did before for VTK (and it worked):
> INCLUDEPATH += /usr/local/include/vtk-5.10 \
>                /usr/local/include/ITK-4.2
>
> LIBS += -lvtkDICOMParser \
>         -lvtkRendering \
>         -lvtkCommon  \
>         -lvtkIO    \
>         -lvtkFiltering  \
>         -lQVTK \
>
>  LIBS += -L/usr/local/lib/ \
>          -lITKCommon-4.1 \
>          -lITKDICOMParser-4.1
>
> QMAKE_CXXFLAGS += -Wno-deprecated
>
> but unfortunately the compiler telling me that: "cannot find
> -lITKCommon-4.1" (I checked, the libraries are in my /usr/local/lib...)
>
> Please help me out. I can't find any solution on the net, just seeing that
> the others had the same problem, but no solution...
>
> Thank you in advance,
> Fabiola.
>

You should not be doing any of this manually - CMake does it all for you.
You should use a CMakeLists.txt file similar to this one:

http://www.vtk.org/Wiki/VTK/Examples/Cxx/Qt/RenderWindowUIMultipleInheritance

but of course also include the standard ITK things (like in any example on
the wiki, like this one:
http://www.itk.org/Wiki/ITK/Examples/SimpleOperations/RequestedRegion )
including find_package/include for ITK and add ${ITK_LIBRARIES} to
target_link_libraries.

David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20120927/35ca55de/attachment.htm>


More information about the Insight-users mailing list