Qt enable and qt4

HI,

I’ve installed qtroot layer for root_5.17.04 with Qt-4.3.2 under mac OS X, but I am failing to compile the first QT base application example in 26ROOTandQt.pdf p424.
It does not find the header:

compile contains:

I’m not sure what I am missing or if I made a mistake during the installation.
Below are the details of the install.

Cheers
-anyes

Qt-4.3.2 is configured with:

where $QTDIR is /Applications/Qt-4.3.2

ROOT 5.17.04 is configured with (see attached config.log):

However, it seems that qt was not enabled.

So I followed the procedure found here:
http://root.cern.ch/phpBB2/viewtopic.php?t=5677

system.rootrc is modified as in 26ROOTandQt.pdf.
$GUI is set to qt

With all this I can run the benchmark.C with QT, but I cannot compile the example code which used a QT library.

This also failed: make qtcint, with “No rule to make target”

config.txt (178 KB)

[quote=“anyes”] . . .
but I am failing to compile the first QT base application example in 26ROOTandQt.pdf p424.[/quote]The chapter is still written for Qt3. The section “Qt Package Installation and Configuration” says,

[quote=“Qt Package Installation and Configuration”]3. Attention. The Qt port for 4.3 and above versions should be considered as an experimental one. Most
examples in this manual are for Qt version 3.3 and they need to be adjusted for Qt 4.3.x.[/quote]

[quote=“anyes”]
compile contains:

I’m not sure what I am missing or if I made a mistake during the installation.[/quote]The example above is written for Qt3. To build it against of the Qt4 one needs:

g++ `root-config --cflags --glibs` -I$QTDIR/include -DQT_GUI_LIB -DQT_CORE_LIB -I$QTDIR/include/QtGui -L$QTDIR/lib -lQtCor e -lQtGui HelloWord.cxx -o HelloWordThe proper version for Qt4 is included in the QtRoot distribution available from BNL CVS Repository. root.bnl.gov/QtRoot/How2Install4 … nstallroot
Have you tried to follow my advice root.cern.ch/phpBB2/viewtopic.php?t=5847 ?

Thank you very much for your config log. It indicates that there is some bug in the ROOT configure script:

Checking for Qt/qglobal.h ... Checking in directory /Applications/Qt-4.3.2/include Checking for Qt/qglobal.h in directory /Applications/Qt-4.3.2/include /Applications/Qt-4.3.2/include/Qt/qglobal.h is read-able Checking whether 4.3.0 <= Qt version < 5.0.0 under /Applications/Qt-4.3.2/include/Qt/qglobal.h grep '# *define *QT_VERSION_STR *' /Applications/Qt-4.3.2/include/Qt/qglobal.h Got Qt version Got 0, min 262912, max 327680 Please update to Qt 4.3.0 Result: noPlease, file the ROOT bug report via savannah.cern.ch/bugs/?func=add … up=savroot
The bug was fixed as root.cern.ch/phpBB2/viewtopic.php?t=5677 said, but later on it was probably re-introduced.

Hi Valerie,

Thanks for you reply, I’m one step further but not quite there.

The compilation command you sent is still giving an error:

Neither QtGui or QtCore libraries are found.
Here a snapshot of what is in the $QTDIR/lib

Am I missing files like

If so, did I miss something when compiling Qt?

Cheers
Anyes

PS: I submitted the bug report for the configuration script.

:open_mouth: Where is the Qt dynamic libraries? I think your question has nothing to do with ROOT. This is the MacOS issue. I have no idea :unamused: where MacOS is supposed to keep the Qt shared libraries. At least your QTDIR/lib contains none.
During Qt installation did you make install Does the qtdemo works after all :question:

Did you read doc.trolltech.com/4.3/install-mac.html ?
It says,[quote] By default, Qt is built as a framework, but you can built it as a set of dynamic libraries (dylibs) by specifying the -no-framework option.[/quote]I am wondering if what you missed is called “dynamic libraries” :bulb:
Anotrher question:
Did you install qt-x11 or qt-mac?

Hi Valerie,

I think my problem is I don’t have the dylib, I did not use the -no-framework option when building Qt.
qtdemo works tho’, and I installed qt-mac.

I’m gonna give it a shot, recompiling w/ that option.


I also tried to make a Root shared lib w/ Qt. I must be doing something stupid (sorry I’m not so familiar w/ root dictionaries) because I’m getting the following compilation error (& warning):

I have a TMyQButton class (.h &.cxx) and the Linkdef.h file
I attached the Makefile and the .pro file that get generated w/ qmake and the Linkdef.h.
Linkdef.h (153 Bytes)
Rootbase_QtApp_2.txt (703 Bytes)
Makefile.txt (10.6 KB)

Try to change your “pro” file. Replace your

CREATE_ROOT_DICT_FOR_CLASSES = ${HEADERS} LinkDef.hwith CREATE_ROOT_DICT_FOR_CLASSES = $$HEADERS LinkDef.hThis is exactly how RootCint example from my “qtExample” kit advises.

[quote=“anyes”]I think my problem is I don’t have the dylib, I did not use the -no-framework option when building Qt.
qtdemo works tho’
[/quote]Yes, qtdemo should work because it was built with the qmake and qmake “knows” how to build the application properly. You should be able to build the HelloWord example with the qmake also. The only problem is the generic shell script. It was designed to work on any platform and requires the dynamic libraries to be built.

[quote=“anyes”]and I installed qt-mac.[/quote]Does that mean that ROOT was working with no X11 via the native Mac GUI interface?

Hi Valeri,

Sorry for the spam… I’m still having problems :confused:

I changed to $$HEADER. Now I get a library:
libRootbase_QtApp_2.1.0.0.dylib
but I get an error loading it.

After recompiling Qt & getting the libraries, I can compile the example of a Qt based Root app. But when I run it, I get the following:

I also tried making a Root based QtApp (like in p425 of Chap 26). This was working earlier before recompiling Qt. Now it cashes (cleaning everything before recompiling):

Also,

I’m not sure if this will answer your question above… I tried a standalone Qt app compiled w/ qmake.
This works perfectly. (even w/ X11 not running)

Hi,

Here an update after hacking the ROOT configure file to get -enable-qt to work and recompiling ROOT.

– Qt based ROOT application example with the following compilation command

This works, independently of have X11 running or not. :smiley:

– ROOT based Qt App (Displays a TGraph)
After adding to the .pro file:

Running the app gives:

The example code is:

The compilation gives some complains for e.g:

Also, trying to make a standalone Root based Qt library (e.g TMyQButton), I get the dylib but no .so

Any :bulb:

Cheers
-a

The reply below was intended for the different forum thread, namely root.cern.ch/phpBB2/viewtopic.php?t=5867

[quote]Check bugs.opensolaris.org/view_bug.do … id=4959553 Does it sounds similar?

(See other links: osdir.com/ml/xfree86.devel/2003-11/msg00205.html )[/quote]

Hi Valeri,

That post did not really help… but googling a little did :slight_smile:

If I put in the .pro file

then the problem goes away.

Here the explanation of the source of the problem:

[quote=“anyes”]Also, trying to make a standalone Root based Qt library (e.g TMyQButton), I get the dylib but no .so [/quote] I think this is correct as far as MacOs is concern. dylib is the extension for the dynamic (aka shared) library on MacOS.