[Insight-users] Problem building QtImageViewer
Luis Ibanez
luis.ibanez@kitware.com
Thu, 05 Dec 2002 18:58:59 -0500
Hi Jarek,
The build of QtImageViewer is working ok for me on a
RedHat 7.2, gcc 3.0.2 and Qt 3.1.
Althought probably the relevant fact is how you are
configuring with CMake.
I only got one rule on my Makefile for
building: QtSlicerGUI.o
The rule looks like:
QtSlicerGUI.o: /kitware/bin/QtImageViewer/QtSlicerGUI.cxx
echo "Building object file QtSlicerGUI.o..."
g++3 -o QtSlicerGUI.o $(INCLUDE_FLAGS) -c
/kitware/bin/QtImageViewer/QtSlicerGUI.cxx
and the (only) rule for QtSliceHelpGUI.o looks like:
QtSlicerHelpGUI.o: /kitware/bin/QtImageViewer/QtSlicerHelpGUI.cxx
echo "Building object file QtSlicerHelpGUI.o..."
g++3 -o QtSlicerHelpGUI.o $(INCLUDE_FLAGS) -c
/kitware/bin/QtImageViewer/QtSlicerHelpGUI.cxx
In your makefile it looks like variables are not being
expanded...
Some questions:
1) What version of CMake are you using ?
2) Is there any risk of having two (or more) different
versions of CMake in your machine...
3) How did you configured the binary directory for building
this example application ?
This is also intended to be built outside the ITK tree...
4) Did you found any error messages or warnings from CMake
while you were configuring this application ?
5) Could you post the CMakeCache.txt file resulting from
CMake configuration of this external project ?
Please let us know
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
>
>