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):
[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.
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 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
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”
Anotrher question:
Did you install qt-x11 or qt-mac?
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)
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?
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)
[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.