Compile trouble with TQtWidget.h at ROOT 5.11/04

Hello!

I was trying to compile the ROOT 5.11/04 but I got this compile error:

g++ -O  -pipe -Wall -W -Woverloaded-virtual -fPIC -Iinclude -DHAVE_CONFIG -pthread -DQT_DLL  -DQT_NO_DEBUG -DQT_SHARED -DQT_THREAD_SUPPORT -I/usr/qt/3/mkspecs/default -I. -I/usr/qt/3/include  -o qt/src/moc_TQtWidget.o -c qt/src/moc_TQtWidget.cxx
qt/src/moc_TQtWidget.cxx:12:2: #error "The header file 'TQtWidget.h' doesn't include <QObject>."
qt/src/moc_TQtWidget.cxx:59: error: `const QMetaObject TQtWidget::staticMetaObject' is not a static member of `class TQtWidget'
qt/src/moc_TQtWidget.cxx:59: error: variable `const QMetaObject TQtWidget::staticMetaObject' has initializer but incomplete type
qt/src/moc_TQtWidget.cxx:65: error: prototype for `const QMetaObject* TQtWidget::metaObject() const' does not match any in class `TQtWidget'
.....

Any hints?

Cheers, Luís

Can you explain step by step what did you do to reproduce your problem?
My impression you have had the old Qt version (v < 3.2) , but the ROOT “configure” does check the Qt version and (should ) provide the warning message.

Hello Fine,
Sorry for lack of information. Here it is.
I have tried the latest version after that, 5.11/06, but got the same error. This is the configure options I have enable/disabled:

./configure linux \
		--disable-alien \
		--disable-chirp \
		--disable-dcache \
		--disable-exceptions \
		--disable-explicitlink \
		--disable-globus \
		--enable-opengl \
		--enable-python \
		--enable-qt \
		--disable-rfio \
		--disable-rpath \
		--disable-sapdb \
		--enable-shadowpw \
		--enable-shared \
		--enable-soversion \
		--disable-srp \
		--disable-table \
		--enable-thread \
		--enable-mathcore \
		--enable-mathmore \
		--enable-reflex \
		--enable-cintex \
		--enable-roofit \
		--enable-minuit2 \
		--enable-fftw3 \
		--enable-qt \
		--enable-qtgsi \
		--enable-astiff \
		--enable-asimage \
		--enable-builtin-afterimage \
		--enable-builtin-afterimage \
		--enable-builtin-freetype \
		--enable-builtin-pcre \
		--enable-builtin-gsl \
		--enable-builtin-zlib 

And this is the output of configure:

Configuring for linux
Checking for libX11 ... /usr/lib
Checking for X11/Xlib.h ... /usr/include
Checking for libXpm ... /usr/lib
Checking whether to build included libfreetype6 ... yes
Checking whether to build included libpcre ... yes
Checking whether to build included zlib ... yes
Checking for GL/gl.h ... /usr/include
Checking for libGL, or libMesaGL ... /usr/lib
Checking for libGLU, or libMesaGLU ... /usr/lib
Checking for occi.h ... no
Checking for libclntsh, or oci ... no
Checking for libocci, or oraocci10 ... no
Checking for sqlext.h ... no
Checking for libiodbc, libodbc, or odbc32 ... no
Checking for qt.h ... /usr/qt/3/include
Checking for libqt-mt, libqt, qt-mt*, qt-mt334, qt-mt335, qt-mt336, or qt ... /usr/qt/3/lib
Checking for moc or moc.exe ... /usr/bin/moc
Checking whether Qt version = 3.xx ... yes
Checking for gfal_api.h ... no
Checking for libgfal ... no
Checking for ApMon.h ... no
Checking for libapmoncpp ... no
Checking for monalisawsclient.h ... no
Checking for libmonalisawsclient ... no
Checking for fftw3.h ... /usr/include
Checking for libfftw3, or libfftw3-3 ... /usr/lib
Checking for jpeglib.h ... /usr/include
Checking for png.h ... /usr/include
Checking for tiffio.h ... /usr/include
Checking for gif_lib.h ... /usr/include
Checking for libjpeg ... /usr/lib
Checking for libtiff ... /usr/lib
Checking for libz ... /lib
Checking for libpng ... /usr/lib
Checking whether to build included libAfterImage ... yes
Checking for Python.h ... /usr/include/python2.4
Checking for libpython2.5, libpython2.4, libpython2.3, libpython2.2, python25, python24, python23, or Python ... /usr/lib/python2.4/config
Checking for xml2-config ... /usr/bin/xml2-config
Checking for libxml2 version >= 2.4.x ... ok
Checking whether to build xrootd ... yes
Checking for libssl ... /usr/lib
Checking for libcrypto ... /usr/lib
Checking for openssl/bio.h ... /usr/include
Checking for openssl/blowfish.h ... /usr/include
Checking for openssl/err.h ... /usr/include
Checking for openssl/pem.h ... /usr/include
Checking for openssl/rand.h ... /usr/include
Checking for openssl/rsa.h ... /usr/include
Checking for shadow passwords ... yes
Checking whether to build libMathCore ... yes
Checking whether to build libMathMore ... yes
Checking whether to build included libgsl ... yes
Checking whether to build libCintex ... yes
Checking whether to build libReflex ... yes
Checking whether to build libRooFit ... yes
Checking whether to build libMinuit2 ... yes
Checking whether to build libTable ... no
Checking for Clarens support ... no
Checking for PEAC support ... no
Generating cint dictionaries.
Checking whether setresuid declared in /usr/include/unistd.h ... yes
Creating include ... done
Creating bin ... done
Creating lib ... done
Writing config/Makefile.config ... done
Writing include/config.h ... done
Writing bin/root-config ... done
Writing etc/system.rootrc ... done
Writing etc/system.rootauthrc ... done
Writing etc/system.rootdaemonrc ... done
Writing etc/root.mimes ... done
Writing etc/daemons/rootd.rc.d ... done
Writing etc/daemons/rootd.xinetd ... done
Writing etc/daemons/proofd.rc.d ... done
Writing etc/daemons/proofd.xinetd ... done
Writing etc/daemons/xrootd.rc.d ... done
Writing etc/daemons/olbd.rc.d ... done
Writing bin/memprobe ... done
Writing build/misc/root-help.el ... done
Writing macros/html.C ... done
Writing config.status ... done

It seems to be OK!

I don’t have an old QT < 3.2, but I have 2 versions of QT installed: 3.3.6 and 4.1.2. Do you think ROOT is getting confused by these 2 versions?

Cheers, Luís

[quote]Hello Fine,
Sorry for lack of information. Here it is.
I have tried the latest version after that, 5.11/06, but got the same error. This is the configure options I have enable/disabled:

Checking for qt.h ... /usr/qt/3/include Checking for libqt-mt, libqt, qt-mt*, qt-mt334, qt-mt335, qt-mt336, or qt ... /usr/qt/3/lib Checking for moc or moc.exe ... /usr/bin/moc Checking whether Qt version = 3.xx ... yes

It seems to be OK!

I don’t have an old QT < 3.2, but I have 2 versions of QT installed: 3.3.6 and 4.1.2. Do you think ROOT is getting confused by these 2 versions?

Cheers, Luís[/quote]
It could be the case. Certainly the header files and libraries belong Qt3

Checking for qt.h ... /usr/qt/3/include Checking for libqt-mt, libqt, qt-mt*, qt-mt334, qt-mt335, qt-mt336, or qt ... /usr/qt/3/lib
However I am not sure about

I would suspect your “/usr/bin/moc” is from Qt4 version.

Pay your attention the error messages came from the “moc” auto-generated files rather from the original ROOT code.

Can you check that?

Hi Valeri,

You got it! My moc is from QT4. I am using Gentoo Linux, some days ago my system suggest to install a new slot of QT lib, but keeping the old 3.3.6. However, the binaries related to this lib have been replaced by the new QT 4.1.2 installation while the header files not.
Does ROOT is ready for QT4? What do you suggest, uninstall my QT4 and reinstall the QT3 (since QT4 is not being used, yet)?

Cheers, Luís

.[quote]Does ROOT is ready for QT4? [/quote]Yes, it does. But …[quote]What do you suggest, uninstall my QT4 and reinstall the QT3 (since QT4 is not being used, yet)?[/quote]I suggest you to keep your Qt 4.1.2 and re-install Qt 3. Either skip “make install” , i.e. do just “make” or install Qt3 to non-default place where it can be found with QTDIR env variable.
I suggest you Qt3 because the Qt3 flavor has been in use for a while and this means it is well tested by many people. What about Qt4, I do not use Qt4 for my real application and have no success report yet :wink: from any body to show you the real Qt 4 appications ( I was told they are coming though :unamused: .

On the other hands, since you have both Qt falvors already installed and Qt-layer is just a ROOT plugin, you can build this plugin twice against of Qt 3 and Qt 4. To switch between two different implementations you need just provide two different versions of your “.rootrc” files.

To get these two plugins I would suggest:

  1. Install ROOT with no --enable-qt flag
  2. Install Qt/Root from the BNL CVS repository twice follow root.bnl.gov/QtRoot/How2Install4 … nstallroot

Speaking about two different Qt-layers you should understand that QT 3 and Qt4 are not compatible. This means it is not enough to get two ROOT plugins, you will be required to provide TWO different versions of your applicatiion too (This requirement has nothing to do with ROOT, it is Qt issue).

Anyway I would appreciate to get one more tester :wink: for Qt 4 based version of Qt/Root.

Hello Valeri,

Thank you for your help.
I have successful installed the ROOT with QT3, since QT4 is not being used yet. The Gentoo Linux currently installs both versions of QT in different places but I couldn’t manage it.

Thank you for the invitation, but I am not a GUI/QT developer, I just install that libraries in case of need.

Cheers, Luís