SCI Seg3D Mailing List

Text archives Help


[Seg3D] Re: Seg3D incompatible with Qt?


Chronological Thread 
  • From: Kristen Zygmunt <krismz@sci.utah.edu>
  • To: seg3d@sci.utah.edu
  • Subject: [Seg3D] Re: Seg3D incompatible with Qt?
  • Date: Fri, 16 Oct 2009 17:36:00 -0600


On Oct 16, 2009, at 4:34 PM, Ramón Casero Cañas wrote:


Hi, sorry for another email!

I tried to use function QwtSpline from library Qwt, that uses Qt, in the new Spline Tool. After adding the path to the header files of Qt4 to the corresponding CMakeLists.txt, I get a weird compilation error

<ERROR>
[ 87%] Building CXX object Applications/Seg3D/CMakeFiles/Seg3D.dir/ SplineTool.cc.o
In file included from /usr/include/qt4/QtCore/qpoint.h:45,
                from /usr/include/qt4/QtCore/QPointF:1,
from /home/ramc/secure_data/comlab/SCIRun.dev/src/ Externals/qwt-5.2/src/qwt_double_rect.h:19,
from /home/ramc/secure_data/comlab/SCIRun.dev/src/ Externals/qwt-5.2/src/qwt_spline.h:14,
from /home/ramc/secure_data/comlab/SCIRun.dev/src/ Applications/Seg3D/SplineTool.cc:12:
/usr/include/qt4/QtCore/qnamespace.h:1113: error: expected identifier before numeric constant
/usr/include/qt4/QtCore/qnamespace.h:1113: error: expected unqualified-id before numeric constant
make[2]: *** [Applications/Seg3D/CMakeFiles/Seg3D.dir/ SplineTool.cc.o] Error 1
make[1]: *** [Applications/Seg3D/CMakeFiles/Seg3D.dir/all] Error 2
make: *** [all] Error 2
</ERROR>


I did some searching, and somebody had a similar error using another library [1]

Quite worryingly, somebody commented on that problem that [2]

"You are trying to build two differents Drivers at the same time : Qt and X11. Both can't be launch together. Moreover, there is a conflict between some Qt "#define" macros and X11 one's."

Does this mean that it is not possible to use functions that depend on Qt in the current architecture of Seg3D? Is there some workaround? Or am I making a silly mistake somewhere?


According to http://braincore.blogspot.com/2005_11_01_archive.html the trouble is that both X11 and Qt define CursorShape. Since you are not currently using Qt CursorShape, a workaround may be to make sure that qwt_spline.h is #included before any X11-related #includes. This seems a bit hacky and if is indeed the case, it's hard to understand why it isn't seen by more people and why it hasn't been fixed by Qt. Qt and X11 are supposed to be able to work together, so I don't think the problem is due to combining them.

-Kris


The horror! Computing the spline is probably going to be a lot more complicated than I thought.


The patch to reproduce the error can be downloaded from:

http://www.paracommunications.org/wiki/codefiles/22091016-231700-error.diff

Note that the only use of a qwt function is in Spline.cc

<SNIPPET>
#include <Externals/qwt-5.2/src/qwt_spline.h>
...
QwtSpline foo;
</SNIPPET>

[1] 
http://hypernews.slac.stanford.edu/HyperNews/geant4/get/installconfig/1072.html

[2] 
http://hypernews.slac.stanford.edu/HyperNews/geant4/get/installconfig/1072/1.html


Best regards,

Ramon.

--
Ramón Casero Cañas, DPhil

Computational Biology, Computing Laboratory
University of Oxford
Wolfson Building, Parks Rd
Oxford OX1 3QD

tlf     +44 (0) 1865 610807
web     http://web.comlab.ox.ac.uk/people/Ramon.CaseroCanas
photos  http://www.flickr.com/photos/rcasero/




Archive powered by MHonArc 2.6.16.

Top of page