[Insight-users] problem linking QT with ITK

Yannick Allard Yannick.Allard at USherbrooke.ca
Wed Jul 14 13:29:57 EDT 2004


Hi Luis,

thank you very much, it did work. I had the same problem with zlib and I did 
the same thing. Everything is fine now.

Yannick

Selon Luis Ibanez <luis.ibanez at kitware.com>:

> 
> Hi Yannick
> 
> 
> Please try the following,
> 
> Take the symbols that are being reported as duplicate
> symbols at link time, and add them to the file
> 
> 
>         Insight/Utilities/png/
>                   itk_png_mangle.h
> 
> 
> Then
> 
>       1) recompile ITK.
>       2) recompile your application.
> 
> 
> The symbols in the itk_png_mangle.h file are mangled to
> prevent them from colliding with external PNG libraries.
> 
> 
> Please let us know if that works ok for you.
> 
> 
>    Thanks
> 
> 
>      Luis
> 
> 
> 
> --------------------
> Yannick Allard wrote:
> 
> > Hi Luis,
> > 
> > I'm using the Insight Toolkit 1.6.0. Here is the error message I get (a
> part of 
> > it... sorry for the formatting...) :
> > ------------------------------------------------------------------
> > g++   main_i386.solaris2.8_g++_debug.o 
> > A_Principal_i386.solaris2.8_g++_debug.o
> ../../lib/i386.solaris2.8/libGUI_i386.so
> > laris2.8_g++_debug.a ../../li
> > b/i386.solaris2.8/libMSDF_INT_i386.solaris2.8_g++_debug.a
> ../../lib/i386.solaris
> > 2.8/libHSI_Util_i386.solaris2.8_g++_debug.a ../../lib/i386.solaris2.
> > 8/libIkonos_Util_i386.solaris2.8_g++_debug.a
> ../../lib/i386.solaris2.8/libPolSAR
> > _Util_i386.solaris2.8_g++_debug.a ../../lib/i386.solaris2.8/libSteve
> > _Util_i386.solaris2.8_g++_debug.a
> ../../lib/i386.solaris2.8/libUtil_i386.solaris
> > 2.8_g++_debug.a /home/kbs/kbs-2.5/lib/i386.solaris2.8/libCortex_i386
> > .solaris2.8_g++_opt.a /home/rnd/pkg/qt-2.3.0/i386.solaris2.8/lib/libqt-
> > mt_i386.solaris2.8_g++_opt.a /home/yallard/glut-3.6/lib/glut/libglut.a -lGL
> -
> > lGLU /home/rnd/pkg/hdf5-1.4.3/i386.solaris2.8/lib/libhdf5.a -
> > lz /home/rnd/pkg/mpich-
> > 1.2.3/i386.solaris2.8/lib/libmpich.a /usr/lib/libaio.so /home/ya
> > llard/GSL/gsl-0.9.3/.libs/libgsl.a /home/yallard/GSL/gsl-
> > 0.9.3/cblas/.libs/libgslcblas.a -lpthread -lthread -lposix4 -lXext -lsocket
> -
> > lnsl -lfl -lX1
> > 1 -lICE -lSM /appl/pkg/public/netpbm-9.19/i386.solaris2.8/lib/libpbm.a
> -lppm -
> > lpgm -lpbm -lm /home/rnd/RND_REPOSITORY/C_Recipes/lib/i386.solaris2.8/
> > libC_Recipes_i386.solaris2.8_g++_debug.a
> /home/rnd/RND_REPOSITORY/MESCH/lib/i386
> > .solaris2.8/libmesch_i386.solaris2.8_g++_debug.a /home/rnd/pkg/tvcpp
> > 0p8/i386.solaris2.8/lib/libvsip.a /home/rnd/pkg/InsightToolkit-
> > 1.6.0/i386.solaris2.8/lib/libitkvnl.a /home/rnd/pkg/InsightToolkit-
> > 1.6.0/i386.solaris
> > 2.8/lib/libITKIO.a /home/rnd/pkg/InsightToolkit-
> > 1.6.0/i386.solaris2.8/lib/libITKCommon.a /home/rnd/pkg/InsightToolkit-
> > 1.6.0/i386.solaris2.8/lib/libi
> > tkvcl.a /home/rnd/pkg/InsightToolkit-
> > 1.6.0/i386.solaris2.8/lib/libitktiff.a /home/rnd/pkg/InsightToolkit-
> > 1.6.0/i386.solaris2.8/lib/libitkjpeg.a /hom
> > e/rnd/pkg/InsightToolkit-
> > 1.6.0/i386.solaris2.8/lib/libITKDICOMParser.a
> /home/rnd/pkg/InsightToolkit-
> > 1.6.0/i386.solaris2.8/lib/libITKMetaIO.a /home/r
> > nd/pkg/InsightToolkit-
> > 1.6.0/i386.solaris2.8/lib/libitkpng.a /home/rnd/pkg/InsightToolkit-
> > 1.6.0/i386.solaris2.8/lib/libitkzlib.a  -o ImagingIDFSRegis
> > _i386.solaris2.8_g++_debug
> > ld: fatal: symbol `png_libpng_ver' is multiply-defined:
> >         (file /home/rnd/pkg/qt-2.3.0/i386.solaris2.8/lib/libqt-
> > mt_i386.solaris2.8_g++_opt.a(png.o) and file
> /home/rnd/pkg/InsightToolkit-
> > 1.6.0/i386.
> > solaris2.8/lib/libitkpng.a(png.o));
> > ld: fatal: symbol `png_sig' is multiply-defined:
> >         (file /home/rnd/pkg/qt-2.3.0/i386.solaris2.8/lib/libqt-
> > mt_i386.solaris2.8_g++_opt.a(png.o) and file
> /home/rnd/pkg/InsightToolkit-
> > 1.6.0/i386.
> > solaris2.8/lib/libitkpng.a(png.o));
> > ld: fatal: symbol `png_IHDR' is multiply-defined:
> >         (file /home/rnd/pkg/qt-2.3.0/i386.solaris2.8/lib/libqt-
> > mt_i386.solaris2.8_g++_opt.a(png.o) and file
> /home/rnd/pkg/InsightToolkit-
> > 1.6.0/i386.
> > solaris2.8/lib/libitkpng.a(png.o));
> > ld: fatal: symbol `png_IDAT' is multiply-defined:
> >         (file /home/rnd/pkg/qt-2.3.0/i386.solaris2.8/lib/libqt-
> > mt_i386.solaris2.8_g++_opt.a(png.o) and file
> /home/rnd/pkg/InsightToolkit-
> > 1.6.0/i386.
> > solaris2.8/lib/libitkpng.a(png.o));
> > ld: fatal: symbol `png_IEND' is multiply-defined:
> >         (file /home/rnd/pkg/qt-2.3.0/i386.solaris2.8/lib/libqt-
> > mt_i386.solaris2.8_g++_opt.a(png.o) and file
> /home/rnd/pkg/InsightToolkit-
> > 1.6.0/i386.
> > solaris2.8/lib/libitkpng.a(png.o));
> > ld: fatal: symbol `png_PLTE' is multiply-defined:
> >         (file /home/rnd/pkg/qt-2.3.0/i386.solaris2.8/lib/libqt-
> > mt_i386.solaris2.8_g++_opt.a(png.o) and file
> /home/rnd/pkg/InsightToolkit-
> > 1.6.0/i386.
> > solaris2.8/lib/libitkpng.a(png.o));
> > ld: fatal: symbol `png_bKGD' is multiply-defined:
> >         (file /home/rnd/pkg/qt-2.3.0/i386.solaris2.8/lib/libqt-
> > mt_i386.solaris2.8_g++_opt.a(png.o) and file
> /home/rnd/pkg/InsightToolkit-
> > 1.6.0/i386.
> > solaris2.8/lib/libitkpng.a(png.o));
> > ld: fatal: symbol `png_cHRM' is multiply-defined:
> >         (file /home/rnd/pkg/qt-2.3.0/i386.solaris2.8/lib/libqt-
> > mt_i386.solaris2.8_g++_opt.a(png.o) and file
> /home/rnd/pkg/InsightToolkit-
> > 1.6.0/i386.
> > solaris2.8/lib/libitkpng.a(png.o));
> > ld: fatal: symbol `png_gAMA' is multiply-defined:
> >         (file /home/rnd/pkg/qt-2.3.0/i386.solaris2.8/lib/libqt-
> > mt_i386.solaris2.8_g++_opt.a(png.o) and file
> /home/rnd/pkg/InsightToolkit-
> > 1.6.0/i386.
> > solaris2.8/lib/libitkpng.a(png.o));
> > ld: fatal: symbol `png_hIST' is multiply-defined:
> >         (file /home/rnd/pkg/qt-2.3.0/i386.solaris2.8/lib/libqt-
> > mt_i386.solaris2.8_g++_opt.a(png.o) and file
> /home/rnd/pkg/InsightToolkit-
> > 1.6.0/i386.
> > solaris2.8/lib/libitkpng.a(png.o));
> > ld: fatal: symbol `png_iCCP' is multiply-defined:
> >         (file /home/rnd/pkg/qt-2.3.0/i386.solaris2.8/lib/libqt-
> > mt_i386.solaris2.8_g++_opt.a(png.o) and file
> /home/rnd/pkg/InsightToolkit-
> > 1.6.0/i386.
> > solaris2.8/lib/libitkpng.a(png.o));
> > ld: fatal: symbol `png_iTXt' is multiply-defined:
> >         (file /home/rnd/pkg/qt-2.3.0/i386.solaris2.8/lib/libqt-
> > mt_i386.solaris2.8_g++_opt.a(png.o) and file
> /home/rnd/pkg/InsightToolkit-
> > 1.6.0/i386.
> > solaris2.8/lib/libitkpng.a(png.o));
> > ld: fatal: symbol `png_oFFs' is multiply-defined:
> >         (file /home/rnd/pkg/qt-2.3.0/i386.solaris2.8/lib/libqt-
> > mt_i386.solaris2.8_g++_opt.a(png.o) and file
> /home/rnd/pkg/InsightToolkit-
> > 1.6.0/i386.
> > solaris2.8/lib/libitkpng.a(png.o));
> > ld: fatal: symbol `png_pCAL' is multiply-defined:
> >         (file /home/rnd/pkg/qt-2.3.0/i386.solaris2.8/lib/libqt-
> > mt_i386.solaris2.8_g++_opt.a(png.o) and file
> /home/rnd/pkg/InsightToolkit-
> > 1.6.0/i386.
> > solaris2.8/lib/libitkpng.a(png.o));
> > ld: fatal: symbol `png_sCAL' is multiply-defined:
> > 
> > -------------------------------------------------------
> > 
> > Yannick
> > 
> > Selon Luis Ibanez <luis.ibanez at kitware.com>:
> > 
> > 
> >>Hi Yannick,
> >>
> >>
> >>What version of ITK are you using ?
> >>
> >>The current CVS version has name mangling for the
> >>PNG library distributed with ITK in the Utilities
> >>directory. That should prevent name conflicts at
> >>link time.
> >>
> >>It will be nice if you post some of the error
> >>messages that you get   :-)
> >>
> >>
> >>Please let us know,
> >>
> >>
> >>    Thanks
> >>
> >>
> >>      Luis
> >>
> >>
> >>---------------------
> >>Yannick Allard wrote:
> >>
> >>
> >>>Hi Everyone,
> >>>
> >>>I'm trying to build an application that use QT to build the GUI and add
> >>
> >>some 
> >>
> >>>ITK functions for image processing. The compilation is going just fine
> but
> >>
> >>at 
> >>
> >>>the link time I've some conflicts between QT and ITK where some
> functions
> >>
> >>are 
> >>
> >>>multiply defined (like the ones for png image support).
> >>>
> >>>I'm NOT using CMake to compile. I'm using gcc 3.2 under solaris 2.8 on a
> >>
> >>intel 
> >>
> >>>platform. Any idea on how to solve the linking problem....
> >>>
> >>>Thank you very much
> >>>
> >>>Yannick
> >>>_______________________________________________
> >>>Insight-users mailing list
> >>>Insight-users at itk.org
> >>>http://www.itk.org/mailman/listinfo/insight-users
> >>>
> >>
> >>
> >>
> >>
> >>
> > 
> > 
> > 
> 
> 
> 
> 
> 




More information about the Insight-users mailing list