[Insight-users] Problem building QtImageViewer
Luis Ibanez
luis.ibanez@kitware.com
Fri, 06 Dec 2002 11:34:56 -0500
Hi Jarek,
Thanks for sending your CMakeCache.txt file.
Using CMake 1.4.6 I was able to reproduce the
problem you reported. The Makefile is generated
with multiple targets for the QtSlicerGUI.o.
This seems to be fixed now in the CVS version
of CMake.
Apparently it is related with the processing
of .h files for the source list in
CMake/Source/cmQTWrapUICommand.cxx
The reason why this problem doesn't show up in
the QtITK example is that this example does not
use .ui files to generate .cxx and .h from them.
QtITK is creating the Qt objects manually.
So,
the solution seems to be to move to the CVS version
of CMake...
Plese let us know if you encounter further problems,
Thanks
Luis
================================================
Jarek Sacha wrote:
> I have problem compiling QtImageViewer. I am running RedHat 8, gcc 3.2,
> qt3.0.5, recent CVS ITK. First Makefile generates warnings:
>
> ----------------------------------------
> Makefile:300: warning: overriding commands for target `QtSlicerGUI.o'
> Makefile:292: warning: ignoring old commands for target `QtSlicerGUI.o'
> Makefile:324: warning: overriding commands for target `QtSlicerHelpGUI.o'
> Makefile:316: warning: ignoring old commands for target
> `QtSlicerHelpGUI.o'
> ----------------------------------------
>
> Looks that targets `QtSlicerGUI.o' and `QtSlicerHelpGUI.o' are generated
> twice, here is a snipped from Makefile:
>
> ----------------------------------------
> 287: #---------------------------------------------------------
> 288: # Build QtSlicerGUI.o From
> /home/sacha/src/tmp/QtImageViewer/QtSlicerGUI.h
> 289: #
>
> 291: QtSlicerGUI.o: /home/sacha/src/tmp/QtImageViewer/QtSlicerGUI.h
> 292: echo "$(CMAKE_CXX_COMPILER) $(CMAKE_CXX_FLAGS) $(INCLUDE_FLAGS) -c
> /home/sacha/src/tmp/QtImageViewer/QtSlicerGUI.h -o QtSlicerGUI.o"
> 293: $(CMAKE_CXX_COMPILER) $(CMAKE_CXX_FLAGS) $(INCLUDE_FLAGS) -c
> /home/sacha/src/tmp/QtImageViewer/QtSlicerGUI.h -o QtSlicerGUI.o
>
> 295: #---------------------------------------------------------
> 296: # Build QtSlicerGUI.o From
> /home/sacha/src/tmp/QtImageViewer/QtSlicerGUI.cxx
> 297: #
>
> 299: QtSlicerGUI.o: /home/sacha/src/tmp/QtImageViewer/QtSlicerGUI.cxx
> 300: echo "$(CMAKE_CXX_COMPILER) $(CMAKE_CXX_FLAGS) $(INCLUDE_FLAGS) -c
> /home/sacha/src/tmp/QtImageViewer/QtSlicerGUI.cxx -o QtSlicerGUI.o"
> 301: $(CMAKE_CXX_COMPILER) $(CMAKE_CXX_FLAGS) $(INCLUDE_FLAGS) -c
> /home/sacha/src/tmp/QtImageViewer/QtSlicerGUI.cxx -o QtSlicerGUI.o
> ----------------------------------------
>
> Make fails linking QtSlicer:
>
> ----------------------------------------
> ++ -rdynamic -g -O2 -ftemplate-depth-50 QtSlicerTest.o QtGlSliceView.o
> QtSlicer.o QtSlicerGUI.o QtSlicerGUI.o moc_QtSlicerGUI.o QtSlicerHelpGUI.o
> QtSlicerHelpGUI.o moc_QtSlicerHelpGUI.o moc_QtGlSliceView.o
> -L/home/sacha/src/Insight-build/bin -L/usr/lib/qt3-gcc3.2/lib
> -lITKAlgorithms -lITKStatistics -lITKFEM -lqt -lGLU -lGL -lITKNumerics
> -lITKIO -litkpng -litkzlib -lITKMetaIO -lITKBasicFilters -lITKCommon
> -lVXLNumerics -lm -lpthread -ldl
> -Wl,-rpath,/home/sacha/src/Insight-build/bin:/usr/lib/qt3-gcc3.2/lib -o
> QtSlicer
> QtSlicerGUI.o: In function `Gui::Gui[not-in-charge](QWidget*, char const*,
> bool, unsigned)':
> /home/sacha/src/tmp/QtImageViewer/QtSlicerGUI.cxx:60: multiple definition
> of `Gui::Gui[not-in-charge](QWidget*, char const*, bool, unsigned)'
> QtSlicerGUI.o:/home/sacha/src/tmp/QtImageViewer/QtSlicerGUI.cxx:60: first
> defined here
> QtSlicerGUI.o: In function `Gui::Gui[in-charge](QWidget*, char const*,
> bool, unsigned)':
> /home/sacha/src/tmp/QtImageViewer/QtSlicerGUI.cxx:60: multiple definition
> of `Gui::Gui[in-charge](QWidget*, char const*, bool, unsigned)'
> QtSlicerGUI.o:/home/sacha/src/tmp/QtImageViewer/QtSlicerGUI.cxx:60: first
> defined here
> QtSlicerGUI.o: In function `Gui::~Gui [not-in-charge]()':
> /home/sacha/src/tmp/QtImageViewer/QtSlicerGUI.cxx:643: multiple definition
> of `Gui::~Gui [not-in-charge]()'
> QtSlicerGUI.o:/home/sacha/src/tmp/QtImageViewer/QtSlicerGUI.cxx:643: first
> defined here
> QtSlicerGUI.o: In function `Gui::~Gui [in-charge]()':
> /home/sacha/src/tmp/QtImageViewer/QtSlicerGUI.cxx:643: multiple definition
> of `Gui::~Gui [in-charge]()'
> QtSlicerGUI.o:/home/sacha/src/tmp/QtImageViewer/QtSlicerGUI.cxx:643: first
> defined here
> QtSlicerGUI.o: In function `Gui::~Gui [in-charge deleting]()':
> /home/sacha/src/tmp/QtImageViewer/QtSlicerGUI.cxx:643: multiple definition
> of `Gui::~Gui [in-charge deleting]()'
> QtSlicerGUI.o:/home/sacha/src/tmp/QtImageViewer/QtSlicerGUI.cxx:643: first
> defined here
> QtSlicerGUI.o: In function `Gui::DisplayIMin(int)':
> /home/sacha/src/tmp/QtImageViewer/QtSlicerGUI.cxx:648: multiple definition
> of `Gui::DisplayIMin(int)'
> QtSlicerGUI.o:/home/sacha/src/tmp/QtImageViewer/QtSlicerGUI.cxx:648: first
> defined here
> QtSlicerGUI.o: In function `Gui::DisplayPosition(int, int, int, float)':
> /home/sacha/src/tmp/QtImageViewer/QtSlicerGUI.cxx:653: multiple definition
> of `Gui::DisplayPosition(int, int, int, float)'
> QtSlicerGUI.o:/home/sacha/src/tmp/QtImageViewer/QtSlicerGUI.cxx:653: first
> defined here
> QtSlicerGUI.o: In function `Gui::DisplaySliceNumber(int)':
> /home/sacha/src/tmp/QtImageViewer/QtSlicerGUI.cxx:658: multiple definition
> of `Gui::DisplaySliceNumber(int)'
> QtSlicerGUI.o:/home/sacha/src/tmp/QtImageViewer/QtSlicerGUI.cxx:658: first
> defined here
> QtSlicerGUI.o: In function `Gui::Help()':
> /home/sacha/src/tmp/QtImageViewer/QtSlicerGUI.cxx:663: multiple definition
> of `Gui::Help()'
> QtSlicerGUI.o:/home/sacha/src/tmp/QtImageViewer/QtSlicerGUI.cxx:663: first
> defined here
> QtSlicerGUI.o: In function `Gui::DisplayIMax(int)':
> /home/sacha/src/tmp/QtImageViewer/QtSlicerGUI.cxx:668: multiple definition
> of `Gui::DisplayIMax(int)'
> QtSlicerGUI.o:/home/sacha/src/tmp/QtImageViewer/QtSlicerGUI.cxx:668: first
> defined here
> QtSlicerHelpGUI.o: In function
> `HelpWindow::HelpWindow[not-in-charge](QWidget*, char const*, bool,
> unsigned)':
> /home/sacha/src/tmp/QtImageViewer/QtSlicerHelpGUI.cxx:344: multiple
> definition of `HelpWindow::HelpWindow[not-in-charge](QWidget*, char
> const*, bool, unsigned)'
> QtSlicerHelpGUI.o:/home/sacha/src/tmp/QtImageViewer/QtSlicerHelpGUI.cxx:344:
> first defined here
> QtSlicerHelpGUI.o: In function
> `HelpWindow::HelpWindow[in-charge](QWidget*, char const*, bool,
> unsigned)':
> /home/sacha/src/tmp/QtImageViewer/QtSlicerHelpGUI.cxx:344: multiple
> definition of `HelpWindow::HelpWindow[in-charge](QWidget*, char const*,
> bool, unsigned)'
> QtSlicerHelpGUI.o:/home/sacha/src/tmp/QtImageViewer/QtSlicerHelpGUI.cxx:344:
> first defined here
> QtSlicerHelpGUI.o: In function `HelpWindow::~HelpWindow
> [not-in-charge]()':
> /home/sacha/src/tmp/QtImageViewer/QtSlicerHelpGUI.cxx:370: multiple
> definition of `HelpWindow::~HelpWindow [not-in-charge]()'
> QtSlicerHelpGUI.o:/home/sacha/src/tmp/QtImageViewer/QtSlicerHelpGUI.cxx:370:
> first defined here
> QtSlicerHelpGUI.o: In function `HelpWindow::~HelpWindow [in-charge]()':
> /home/sacha/src/tmp/QtImageViewer/QtSlicerHelpGUI.cxx:370: multiple
> definition of `HelpWindow::~HelpWindow [in-charge]()'
> QtSlicerHelpGUI.o:/home/sacha/src/tmp/QtImageViewer/QtSlicerHelpGUI.cxx:370:
> first defined here
> QtSlicerHelpGUI.o: In function `HelpWindow::~HelpWindow [in-charge
> deleting]()':
> /home/sacha/src/tmp/QtImageViewer/QtSlicerHelpGUI.cxx:370: multiple
> definition of `HelpWindow::~HelpWindow [in-charge deleting]()'
> QtSlicerHelpGUI.o:/home/sacha/src/tmp/QtImageViewer/QtSlicerHelpGUI.cxx:370:
> first defined here
> collect2: ld returned 1 exit status
> make[1]: *** [QtSlicer] Error 1
> make: *** [default_target] Error 2
> ----------------------------------------
>
> Note that I can compile and run QtITK example application fine.
>
> Help resolving this greatly appreciated.
>
> Jarek
>
> __________________________________________________
> Do you Yahoo!?
> Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
> http://mailplus.yahoo.com
> _______________________________________________
> Insight-users mailing list
> Insight-users@public.kitware.com
> http://public.kitware.com/mailman/listinfo/insight-users
>
>