QTRoot BNL

Root Users,

I have recently been attempting to use QTroot (BNL version). I am using the QT version 4.7.0 in WIndows, as well as the Root QT brand from BNL version 5.24.0. When I attempt to run the simple example from the root manual (shown below), I have a number of problems.

#include <qapplication.h>
#include <TApplication.h>
#include "TGraph.h"
#include "TQtWidget.h"
#include "TCanvas.h"


int main( int argc, char **argv ) {
    QApplication *app = new QApplication(argc, argv);
   // TQtWidget *MyWidget= new TQtWidget(0,"MyWidget");
    // Create any other Qt-widget here
   // MyWidget->show();
   // MyWidget->GetCanvas()->cd();
   // TGraph *mygraph;
    float x[3] = {1,2,3};
    float y[3] = {1.5, 3.0, 4.5};
   // mygraph  = new TGraph(3,x,y);
   // mygraph->SetMarkerStyle(20);
   // mygraph->Draw("AP");
   // MyWidget->GetCanvas()->Update();
    app->exec();
    return 0;
}

qmake file:

# Automatically generated by qmake (1.07a) Sun Jun 26 02:03:47 2005
# Adjusted by hand to include $ROOTSYS/include/rootcint.pri file

TEMPLATE = app thread
CONFIG -= moc
INCLUDEPATH += .
include("C:/BNL/ROOT/include/rootcint.pri")
# include "by hand" the qmake include file from
# ROOT distribution to define
#  1. include path to the ROOT system header files
#  2. the list of the ROOT shared libraries to link
#     Qt application against of
#  3. qmake rules to generate ROOT/Cint dictionaries
# Input
SOURCES += main.cpp

When compiling, the following error results.

Any help regarding this matter would be very much appreciated.

Regards.

Hi,

Most likely there is a mixing of build (either different compiler or different version of ROOT).

Cheers,
Philippe.

Dear Philippe,
That did appear to be cause of my problem and I have now fixed this. However, I now have another apparently simple problem which I can’t seem to overcome. I have tried to compile the QTRoot BNL examples (in this case the HelloWord example). I am developing in QT Creator and upon compilation the following error now results:-

C:/BNL/ROOT/QtRootExamples/HelloWord-build-desktop/…/HelloWord/HelloWord.cxx:1: error: C1083: Cannot open include file: ‘TRint.h’: No such file or directory

The environment variables which point to the QT root library files seems to be OK, however it doesn’t appear to be found. Therefore, In the QT .pro file I have added the following line to ensure that the include files are pointed to.

INCLUDEPATH += . c:\BNL\ROOT\include

which then leads to the following error

mt.exe : general error c101008d: Failed to write the updated manifest to the resource of file “debug\HelloWord.exe”. Access is denied.

Does anyone have any ideas?

Regards, Nick.

[quote]mt.exe : general error c101008d: Failed to write the updated manifest to the resource of file “debug\HelloWord.exe”. Access is denied.
[/quote]This usually means that the file is still be access by some other process …

Philippe.

Philippe,

Just as you posted, I noted that mt.exe is being accessed by some spyware/antivirus software. This has been disabled. This still leaves me with the issues not being able to compile because the libraries are not being found. I simply cannot understand this. The rootcint.pri file in included in the .pro file, and the the QTCreator does recognise the QTroot libraries to be in the relevant folder.

It is only when compiling that I have the “Cannot open include file” problem.

Regards,
Nick.

[quote]It is only when compiling that I have the “Cannot open include file” problem.
[/quote]I thought you solved that problem by adding the ROOT include directory to the include directive …

Philippe.

Philippe,
Apologies, I have missed a step in my explanation. I had solved that problem which was subsequently followed up by the problem with the mt.exe. Once I resolved the mt.exe problem (and with the INCLUDEPATH set to c:\bnl\root\include to overcome the initial problem) the code compiles but immediately crashes (see image attached at the URL below, but I’m afraid it is fairly unhelpful and only demonstrates what happens when building and running).

https://docs.google.com/leaf?id=0Bw7N_dzAGbmKOGYyZDFmNDItYmRhOS00MDc4LThkNjMtNjc5NTBiYjgzNDcy&hl=en

There are no clues as to the reason behind this in the compiler output which is detailed below.

[quote]Running build steps for project HelloWord…
Configuration unchanged, skipping qmake step.
Starting: "C:\Qt\qtcreator-2.1.0\bin\jom.exe"
C:\Qt\qtcreator-2.1.0\bin\jom.exe -nologo -j 2 -f Makefile.Debug

jom 1.0.3 - empower your cores

The process “C:\Qt\qtcreator-2.1.0\bin\jom.exe” exited normally.[/quote]

It appears that my problem seems to lie with my environment settings and that simply adding INCLUDEPATH+= c:\bnl\root\include causes some conflict which causes the compiled code to crash unexpectedly.

I have abandoned the QT+Root implementation within the windows environment, and have moved back to installing qtRoot in Ubuntu using the install shell script. This appears to have been successful and I have attempted to run some on the qtRoot examples again. Unfortunately I am still having difficulties. I have followed the installation instruction meticulously to no avail.

From within QtCreator I build the Qt4.pro example. The following stack trace is produced. I would appeciate any help with this as I am stumped!! #-o

Regards, Nick.

[quote]It appears that my problem seems to lie with my environment settings and that simply adding INCLUDEPATH+= c:\bnl\root\include causes some conflict which causes the compiled code to crash unexpectedly.[/quote]If this is the case then the header file in c:\bnl\root\include are not matching with some of the library (and/or some of your compiled code) … i.e. there is some sort of conflict between 2 root version installed locally.

Philippe.

For now I am going to leave the windows version of this install alone and I have moved back to working within linux (namely Ubuntu 10.10). I used the INSTALL_QTROOT.sh script and everything built fine.

I spent a whole day developing some simple apps and running some of the qtRoot examples (such as HelloCanvas). HOWEVER, after installing tetex-base I can no longer run any of the qtRoot examples or my own code for that matter.

I ran the debugger and the programs that I run immediately seg fault, apparently due to some issues with freetype fonts and the Load_glyph function. Has anyone come across this problem before???

Problem solved. The INSTALL_QTROOT.SH file downloaded QT libraries version 4.6.3. This version did not appear to work with the QtRoot examples (or any of my examples). I manually installed the most up to date version 4.7.2 QT libraries and everything now works well. Quickly browsing the web, the font problems (particularly with the GLYPH_LOAD function) were a well known problem with QT when running on Ubuntu. This bug seems to have been ironed out in recent versions of the QT libraries.

Regards.

Sorry I was out of touch :blush: and missed this thread.
I understand that Qt ROOT works for you under LINUX.
I would appreciate if you could elaborate a little bit more about your Windows installation. Ideally, I would like to see the “installation log”. Please do not forget to explain where your Visual C++ env and Qt Creator came from. Normally Qt Creator is to be used with minGW env and g++ compiler. However, I am not aware about successfull ROOT installation within MinGW and for sure none has tried QtRoot with that tool.

Did you try to install ROOT and Qt from the scratch with Visual C++ and with INSTALL_QTROOT and tried to build the ROOT examples WITHOUT Qt Creator installation. Did you make sure you did not try to compile 64-bit application? There is no working version of ROOT for 64-bit Microsoft env. yet. (nothing to do with Qt. Search this forum for details)

What you described may indicate the presence of the mix of the different tools libraries/compilers etc. The log may have eliminated the guess job.

In the other words did you apply the “INSTALL_QTROOT.sh” script alone and from the scratch (no Qt, No Qt Creator, no ROOT) ?
Thank you.

Hi,
I am trying to build a Qtwidget with a Root window for online data acquisition.
I am using Qt 4.7 in Windows 7 and
I am having the same problems described by nppatt with messages like

C:/BNL/ROOT/include/TVersionCheck.h:34: undefined reference to TVersionCheck::TVersionCheck(int)' C:/BNL/ROOT/include/TApplicationImp.h:39: undefined reference toTString::~TString()‘
C:/BNL/ROOT/include/TApplicationImp.h:39: undefined reference to TString::~TString()' C:/BNL/ROOT/include/TCanvasImp.h:78: undefined reference toTCanvasImp::Class()’

Basically I am not able to link the qtroot libraries, even by specifiyng the correct full path to the .lib file.
I think the point is that QT uses mingw whereas Root libraries were compiled using Visual C++

As I understad npatt had solved the problem, so probably there is a solution.
Could someone tell me a sufficiently detailed procedure to make it work ?

Probably the solution would be to compile the root source with mingw,
but i am not experienced enough to do it from scratch

Thank you very much

The only known way to get QtRoot for Windows is to follow root.bnl.gov/QtRoot/INSTALL_QTROOT.sh The script takes time to complete but it install all compnents you need including the correct versions of Qt and ROOT.
Please, check search.php?author_id=8403&sr=posts
Be aware the last tested version of QtRoot for Windows in 5.26.00b.

You are recommended to choose very this version for your installation.
To do that you will need to edit the installation script to get:

ROOT_VERSION_MAJOR=5.26 ROOT_VERSION_MINOR=00b