Build Root 5.26.00b with QT support under Win32

Dear rooters,

I am trying to build root 5.26.00b (from svn) with qt support, but am consistently failing…

Environment:
-Windows 7 64-bit (but compiling as 32-bit)
-MS Visual Studio 2008, SP1
-qt 4.6.2 (opensource), built from sources.

Commands leading to the problem:
(in cygwin bash, with vsvars32.bat run before to set environment variables):

./configure win32 --enable-qt
make

After quite a while, compilation fails with the error message

graf2d/qt/src/G__GQt.cxx(3644) : error C2248: 'TQtWidget::RefreshCB' : cannot access protected member declared in class 'TQtWidget'
        include\TQtWidget.h(247) : see declaration of 'TQtWidget::RefreshCB' 
        include\TQtWidget.h(98) : see declaration of 'TQtWidget'
make: *** [graf2d/qt/src/G__GQt.o] Error 2

The file graf2d/qt/src/G__GQt.cxx is apparently generated by rootcint.
Is qt version qt 4.6.2 incompatible or did I do something wrong?

Thanks,

Moritz

Hi Moritz,

ROOT & Qt is not officially supported on Windows.
If you want to use ROOT & Qt on Windows, you can use the version from BNL, available at this location: Qt ROOT from STAR

Cheers, Bertrand.

QtRoot for Windows is supported by BNL
Please try root.bnl.gov/QtRoot/How2Install.html

[quote=“moritz”]Dear rooters,

I am trying to build root 5.26.00b (from svn) with qt support, but am consistently failing…
. . . .
After quite a while, compilation fails with the error message

graf2d/qt/src/G__GQt.cxx(3644) : error C2248: 'TQtWidget::RefreshCB' : cannot access protected member declared in class 'TQtWidget'
        include\TQtWidget.h(247) : see declaration of 'TQtWidget::RefreshCB' 
        include\TQtWidget.h(98) : see declaration of 'TQtWidget'
make: *** [graf2d/qt/src/G__GQt.o] Error 2

The file graf2d/qt/src/G__GQt.cxx is apparently generated by rootcint.
Is qt version qt 4.6.2 incompatible or did I do something wrong?
[/quote]Even though one has to patch the CERN distribution to get the QtRoot working on Windows one should NOT see any COMPILATON problem.
I think this is a problem of RootCint that is unrelated to the Qt/ QtRoot. The method TQtWidget::RefreshCB is the “protected” indeed and it should not be a part of the dictionary.

Thank you for your report. I’ve found some correction was not propagated to CERN.
The patch below fixes the discrepancy between BNL and CERN
repositories. It should resolve the compilation issue. However, you still need the full BNL version to get QtRoot working under Windows.

[code]Index: inc/TQtWidget.h

— inc/TQtWidget.h (revision 32415)
+++ inc/TQtWidget.h (working copy)
@@ -243,10 +243,10 @@
virtual bool Save(const char *fileName) const;
virtual bool Save(const QString &fileName,const char *format,int quality=60) const;
virtual bool Save(const char *fileName,const char *format,int quality=60) const;
+#ifndef CINT
protected slots:
void RefreshCB();

-#ifndef CINT
signals:
// emit the Qt signal when the double buffer of the TCamvas has been filled up
void CanvasPainted(); // Signal the TCanvas has been painted onto the screen[/code]

Hi Valeri,

thank you for the patch.
Now it does compile but, just as you predicted, there is no graphical user interface in QT mode.

Following Bertrand’s hint, I tried getting the BNL version to run for some time. However, this has not worked out so far.

*The binary distribution apparently does not like my compiler’s output (VC++ 2008 Prof., ServicePack 1). It crashed whenever I tried loading something with ACLIC. I had problems with libraries compiled by the original VC++ 2008 (without SP1) before. If you used this version to compile root, the crash is probably caused by that incompatibility.
*The “install from sources” script did not run through either. It downloaded an older version of root, your patches, started compiling but error-exited at some point (with apologies). At the moment I let it run again to reproduce the message.

All this is somewhat frustrating. Everything I wanted to do is show a root histogram in a QT application. (It can even have its own window. I just need some kind of TApplication that doesn’t fight with QApplication)…
Do I need what I am trying to get or is there an easier way?

Thanks,

Moritz

PS: On your “how to install” page, you give some hints on windows 64-bit components. Can BNL root be compiled as 64-bit? (I would be very interested because of win32’s memory restrictions.)

Hello Moritz,

[quote=“Moritz”] … Now it does compile but . . . [/quote]Ok. Thank you. [quote=“Moritz”] *The binary distribution apparently does not like my compiler’s output (VC++ 2008 Prof., ServicePack 1). [/quote]I understand that
[ul] 1. QtRoot binary does work alone.
2. You can not use your VS2008 compiler to compile your ACLiC macros.[/ul] It is expected.
It was done with VS2005 and root/bin does include VS2005 DLL’s and manifests.[quote=“Moritz”] … The “install from sources” script did not run through either. It downloaded an older version of root, your patches, started compiling but error-exited at some point (with apologies). At the moment I let it run again to reproduce the message. [/quote]Ok, I am awaiting that. I need to see what you did to advice.[quote=“Moritz”] … All this is somewhat frustrating. Everything I wanted to do is show a
root histogram in a QT application. (It can even have its own window. I
just need some kind of TApplication that doesn’t fight with
QApplication)… [/quote] “QT application” implies you need the full-fledged QT SDK.[quote=“Moritz”]I just need some kind of TApplication that doesn’t fight with QApplication).[/quote]What you really need is QtROOT plugin for the regular ROOT.
This is how things work for Unix and Mac platforms. One can complement the existing ROOT installation with QtRoot
root.bnl.gov/QtRoot/How2Install4 … complement This is 5 min job indeed for those platforms.

However, by some reason CERN accepted the correction needed to interface Qt and ROOT for X11 platfrom and did not accept it for Windows. This is why you need to patch ROOT and recompile it too.
(my script contains all information one need and shows what should be done)[quote=“Moritz”]. . .Is there an easier way? [/quote]Well you need to run that script. That’s what I did to make it easier for you. It should not be trouble. As soon as you face any problem just drop me message. Do not fight it alone.

You need to get all your components built with one and the same compiler anyway.
The most complex part of QtRoot installation is the Qt installation. It takes enormous amount of time.
Fortunately, Nokia has done this MUCH simpler by releasing the pre-built binaries

What you need to do is to install Qt from binaries

  1. qt.nokia.com/downloads/windows-cpp-vs2008
  2. Edit your cygiwn/cygwin.bat file to add there the line

call C:\Qt\4.6.2\bin\qtvars.bat vsvars to make it look like this @echo off C: chdir C:\cygwin\bin call C:\Qt\4.6.2\bin\qtvars.bat vsvars bash --login -iand restart your cygwin. You should get the Cygwin prompt with QTDIR and VS environment defined.
then do wget http:://root.bnl.gov/QtRoot/INSTALL_QTROOT.sh chmod +x INSTALL_QTROOT.sh ./INSTALL_QTROOT.sh … and it should take you less them hour to complete the first installation.[quote=“Moritz”] PS: On your “how to install” page, you give some hints on windows 64-bit
components. Can BNL root be compiled as 64-bit? (I would be very
interested because of win32’s memory restrictions.) [/quote]

To be clear, BNL has no its own ROOT at all. The script in question downloads ROOT source from CERN directly.

I do not anticipate any additional problem with QtRoot compilation.
However, I am not sure whether the ROOT “configure” is smart enough to recognize the 64-bit capability (Bertrand should know the answer)

[quote=“moritz”]…
thank you for the patch.

It … started compiling but error-exited at some point (with apologies). At the moment I let it run again to reproduce the message.
[/quote]To reproduce your trouble I’ve installed the latest Cygwin on my son’s Win7 64-bits machine and “MS Express Edition”.
I’ve found with the latest cygwin one needs one extra patch to adjust the Makefile[code]— oldqtRoot/qtgl/Module.mk.unix 2010-02-14 23:54:51.957000000 -0500
+++ newqtRoot/qtgl/Module.mk.unix 2010-02-27 00:11:44.429000000 -0500
@@ -105,8 +105,11 @@

cp $< $@

ifeq ($(ARCH),win32)
+
QTGLLIBEXTRA += lib/QGLViewer.lib $(WIN32GDKLIBEXTRA)

  • $(QGLVIEWERDIRBIN)/$(BINPREFIX)$(QGLVIEWERNAME).lib:

+$(QGLVIEWERDIRBIN)/$(BINPREFIX)$(QGLVIEWERNAME).lib: $(QGLVIEWERDIRBIN)/$(BINPREFIX)$(QGLVIEWERNAME).$(SOEXT)
+
$(QGLVIEWERDIRBIN)/$(BINPREFIX)$(QGLVIEWERNAME).$(SOEXT): $(QGLVIEWERDIR)/Makefile include/QGLViewer
cd $(QGLVIEWERDIR); $(QTGLMAKE)
[/code]Is it the place where your compilation was interrupted ?
I’ve updated my repository and uploaded the new version.
You are recommended to re-run the script:

wget http:://root.bnl.gov/QtRoot/INSTALL_QTROOT.sh chmod +x INSTALL_QTROOT.sh ./INSTALL_QTROOT.shTo continue the build quickly do

source set_environment.sh cd root make

I’ve re-run the ROOT and QtRoot installation for several times. ( Qt 4.6.2 binaries + VS2008 Express Edition on Win7 64-bits + Cygwin CYGWIN_NT-6.1-WOW64)
I found the ROOT Makefile sometimes stops with

make: *** No rule to make target `net/xrootd/src/xrootd/bin/xrdcp.exe', needed b y `bin/xrdcp.exe'. Stop.I found one can successfully complete the installation by source set_environment.sh cd root make I do not think the issue is QtRoot related and I do now know whether you need to install that "xrdcp.exe’.

Hi Valeri,

thank you very much for the testing and patching!

The error message I got in the first place was probably the same you found:

cp: cannot stat `qtgl/qglviewer/QGLViewer/debug/dQGLViewer2.lib': No such file o
r directory
make: *** [lib/QGLViewer.lib] Error 1

Your makefile patch solved this.

Then I also ran into the “xrdcp.exe” problem. To get around it, I just disabled xrootd (don’t need it anyway) by appending line 661 of INSTALL_QROOT.sh with

--disable-xrootd

The next issue was not far away but is probably caused by my QT installation. The computer is currently redoing everything (including the qt build). I will let you know what comes out.

Thanks again,

Moritz

PS: Regarding the possibility of a Win64 build, Bertrand gave his answer already: http://root.cern.ch/phpBB2/viewtopic.php?p=39618#39618

[quote=“moritz”] . . . The error message I got in the first place was probably the same you found:

Your makefile patch solved this.[/quote]Ok, :slight_smile: Thank you.[quote=“moritz”]Then I also ran into the “xrdcp.exe” problem. To get around it, I just disabled xrootd (don’t need it anyway) by appending line 661 of INSTALL_QROOT.sh with--disable-xrootd [/quote]I’ve added this into my distribution and uploaded the new version.[quote=“moritz”]The next issue was not far away but is probably caused by my QT installation. [/quote]Which one :question:
I’ve found one more problem caused by the latest Cygwin.
In fact, all problems we have discussed / fixed were not Qt/ROOT/VC related. Most of them were caused by latest version of Cygwin / Cygwin make. This is why I missed it. I did not :blush: upgrade my Cygwin.
You may need to apply

[code]— oldQtRroot/MyMakefile.depend 2010-02-14 23:25:16.311000000 -0500
+++ newQtRoot/MyMakefile.depend 2010-02-27 16:36:51.798600000 -0500
@@ -5,9 +5,9 @@
QTINCDIR ?= $(QTDIR)/include
QTSYSTEMLIB = $(QTLIBDIR) $(QTLIB)
ifeq (yes,$(WINRTDEBUG))
-QTSYSTEMLIB += $(shell cygpath -m $(QTDIR)/lib/QtWebKitd4.lib $(QTDIR)/lib/QtNetworkd4.lib )
+# – QTSYSTEMLIB += $(shell cygpath -m $(QTDIR)/lib/QtWebKitd4.lib $(QTDIR)/lib/QtNetworkd4.lib )
else
-QTSYSTEMLIB += $(shell cygpath -m $(QTDIR)/lib/QtWebKit4.lib $(QTDIR)/lib/QtNetwork4.lib)
+# – QTSYSTEMLIB += $(shell cygpath -m $(QTDIR)/lib/QtWebKit4.lib $(QTDIR)/lib/QtNetwork4.lib)
endif

ifeq ($(PLATFORM),win32)[/code] and just call “make” again. (It has been included into the distribution too).source set_environment.sh cd root make[quote=“moritz”]The computer is currently redoing everything (including the qt build). I will let you know what comes out.[/quote]Ok. Let me know.

[quote=“moritz”]PS: Regarding the possibility of a Win64 build, Bertrand gave his answer already: http://root.cern.ch/phpBB2/viewtopic.php?p=39618#39618[/quote]Interesting :unamused:
Well, my question was

[quote=“fine”]… I am not sure whether the ROOT “configure” is smart enough to recognize the 64-bit capability[/quote]From this stand point the Bertrand’s clause:

[quote=“bellenot”] It requires quite a lot of changes in ROOT itself, but also in other libraries used by ROOT… [/quote] sounds like “ROOT configure can not recognize and set the proper 64-bits compilation options for VC++ environment”.
On the hands, I think it is worth to try. Why I think this way? See yourself:
[ul]1. 64-bits ROOT is built and is used on 64-bits UNIX
2. QtRoot 64-bits plug-in is used on UNIX as well.[/ul]Bertrand did not clarify which “the other libraries used by ROOT” are needed.
That suggests that He may mean the Win32 specific portion of the ROOT system. Fortunately, with QtROOT one needs NONE Win32/ROOT code at all. (you may lose something like xrootd :unamused: though). However, I am not saying the ROOT-Win64 is trivial thing to do :wink:

Hi Valeri,

I am sorry, but it still does not work…

The installation run of yesterday failed again, because somewhere it tried to link both the debug and the non-debug .lib files of qt.

So I removed everything (rm -rf style) and restarted from scratch. Your most recent update in the repository solved the linking problem and the xrdcp.exe thing is gone, too.

Now it runs through until the following message appears:

==> lib/libQtGed.dll done
cd qtgl/qglviewer/QGLViewer;  C:\prog\qt\qt-everywhere-opensource-src-4.6.2_dll/
bin/qmake CONFIG+=debug
/bin/sh: C:progqtqt-everywhere-opensource-src-4.6.2_dll/bin/qmake: No such file
or directory
make: *** [qtgl/qglviewer/QGLViewer/Makefile] Error 127
rm core/utils/src/RStl_tmp.cxx core/utils/src/rootcint_tmp.cxx

just typing “qmake” in the bash shell calls the right qmake, so it is definitely there…
To me this looked suspiciously like a windows / cygwin path style conflict. So I changed $ROOTSYS and $QTDIR to cygwin-style. In this configuration,

cd root
make

yields

TQtGLViewerImp.cxx
C:\prog\root\5.24.00_src_bnl\root\include\TQtGLViewerImp.h(195) : warning C4521:
 'TQtGLViewerImp' : multiple copy constructors specified
c:\prog\root\5.24.00_src_bnl\root\include\qglviewer\manipulatedCameraFrame.h(26)
 : fatal error C1083: Cannot open include file: 'manipulatedFrame.h': No such fi
le or directory
make: *** [qtgl/qtgl/src/TQtGLViewerImp.o] Error 2

So, no success so far :frowning:

Moritz

[quote=“moritz”]… it still does not work…
Now it runs through until the following message appears: ... /bin/sh: C:progqtqt-everywhere-opensource-src-4.6.2_dll/bin/qmake: No such file or directory... just typing “qmake” in the bash shell calls the right qmake, so it is definitely there…[/quote] It is NOT :exclamation: there. Check the path :bulb: portion above. It is

C:progqtqt-everywhere-opensource-src-4.6.2_dll/bin/qmake The backslashes gone (the kind of problem I did not see with the previous version of Cygwin. You needed C:/prog/qtqt-everywhere-opensource-src-4.6.2_dll/bin/qmake Why that happended.

[quote=“moritz”]cd root make
So, no success so far :frowning:
…[/quote]You missed :exclamation: source set_environment.sh
Please, read my message again. You need: source set_environment.sh cd root make However, this is the shortcut for the experienced users. The correct step is to restart INSTALL_QTROOT.sh. It is smart enough to continue the build.

Ok. There are TWO problems.
[ul]1. One cannot use the “parallel build” “make -j4” to build some portion of the plain ROOT. It should be seen with no Qt. I do not know the reason. I did not investigate the ROOT Makefile. It has nothing to do with Qt. Bertrand should know this. I did not see this with the older version of Cygwin. I used to use the same ROOT Makefile to build ROOT with the previous Cygwin and it did work with no interruption

2. There is a Cygwin issue[/ul]The solution (workaround): source set_environment.sh cd root make to restart the build as soon one encounters the ROOT-Makefile-related problem b[/b] and to avoid the Cygwin issue b[/b].
Let me say, that I have repeated the installation several times from the scratch (remove all files and restart “INSTALL_QTROOT.sh” from the new Cygwin session on Win7/64-bits + Qt 4.6.2-binaries + VS Express Edition 2008 and did work. It was interrupted at once and after an extra push (may be Bertrand can comment this fact): source set_environment.sh cd root make ended up successfully .

Hello Rooters,

I am also trying to build root 5.26.00b with qt support, but I am getting a compilation error when executing INSTALL_QTROOT.sh.

Environment:
-Windows 7 64-bit
-MS Visual Studio 2008, SP1
-qt 4.6.3 (opensource), built from binary.

After setting Cygwin.bat to c:\Qt\4.6.3\bin\qtvars.bat vsvars, I execute the following command to run the script: ./INSTALL_QTROOT.sh.

After copying many of the root include files, the prompt tries to build “main.c”, but once it begins the output begins to repeat characters and scramble: bbuuiilldd//rrmbmkbukduideilepldped/ .... NOTE: I was having issues copy-and-pasting the text generated by Cygwin so I am going to attach a screenshot of the output. To make things slightly easier to find, I put a star next to where the error starts.

I’m not sure whether the problem is with the script or with my cygwin – I must confess, I am a Cygwin / Qt Root newbie – but I have re-ran the script (after erasing all of the newly-created files) and the exact same error occurs at the same point of the compilation. Any help would be greatly appreciated.

Thanks so much,
-Jake


I’ll check it tonight. I have a limited internet access right now.
Thank you.

[quote=“jneal”]Hello Rooters,

I am also trying to build root 5.26.00b with qt support, but I am getting a compilation error when executing INSTALL_QTROOT.sh.

Environment:
-Windows 7 64-bit
-MS Visual Studio 2008, SP1
-qt 4.6.3 (opensource), built from binary.
[/quote]

I suspect there is some problem with your “-MS Visual Studio 2008, SP1” installation or mismatch between your VS2008 installation and VS environment set by “c:\Qt\4.6.3\bin\qtvars.bat vsvars” script.

Did you compile “qt 4.6.3” from the source yourself or installed the pre-compiled binaries?
I would like to call your attention to the fact that the header file “sehmap.h” is a part of VC system. Your log indicates it was certainly present.

[quote=“jneal”]
I’m not sure whether the problem is with the script or with my cygwin – I must confess, I am a Cygwin / Qt Root newbie – but I have re-ran the script (after erasing all of the newly-created files) and the exact same error occurs at the same point of the compilation. Any help would be greatly appreciated.
[/quote]You log gave me no clue what went wrong. That happened during the regular ROOT Makefile invocation. To understand where the problem comes from can you install the vanilla ROOT first. (with no Qt and with no script ) follow the regular CERN procedure.