RE: ROOT Qt Manual Example

From: Fine, Valeri <fine_at_bnl.gov>
Date: Wed, 19 Apr 2006 18:58:47 -0400


Hello Kerry

Did you do what the page 393 says?  

Qt-layer configuration

Any ROOT-based application should be configured to use Qt-layer using ROOT "Environment Setup". There

are several ways to customize the ROOT setup environment to activate Qt-layer.

Look up at $ROOTSYS/etc/system.rootrc. Find there the definition of Gui.Backend and Gui.Factory:  

# GUI specific settings

Gui.Backend: native

Gui.Factory: native  

Now you can either edit the file $ROOTSYS/etc/system.rootrc or provide your own custom .rootrc one

that redefines the options:

# GUI specific settings

Gui.Backend: qt

Gui.Factory: qt

If you are going switching often from native layer to qt one and back you may find it is convenient to define the

type of GUI using some external environment variable defining options indirectly:

# GUI specific settings

Gui.Backend: $(GUI)

Gui.Factory: $(GUI)

The last step is to make sure your LD_LIBRARY_PATH variable point to the $QTDIR/lib directory. Optionally,

you can define the Qt Widget "look and fell" using the option Gui.Style option. The number of the different

styles to choose from is defined by your local Qt installation. Usually you can choose from "window", "motif",

"cde", "motifplus", "platinum", "sgi", "compact", "windowsxp", "aqua" or "macintosh". For example the option

defined below will force the "windows" look and feel on any platform.  

Dear ROOT team,

I am using ROOT 5.11.02 on CentOS (linux) compiled with gcc 3.4.4.

I have tried to duplicate the Qt example in the manual. The output of qmake and make are below.

[kerrylee_at_jsc-sf-2148872 MyQButtonEx]$ qmake MyQButton.pro WARNING: Failure to find: Dict.cxx
[kerrylee_at_jsc-sf-2148872 MyQButtonEx]$ make g++ -c -pipe -Wall -W -O2 -g -pipe -m32 -march=i386 -mtune=pentium4
-fPIC -DQT_NO_DEBUG -DQT_SHARED -DQT_THREAD_SUPPORT
-I/usr/lib/qt-3.3/mkspecs/default -I. -I"/include"
-I"/home/root/gcc/5.11.00/root/include" -I/usr/lib/qt-3.3/include -o
TMyQButton.o TMyQButton.cxx
/home/root/gcc/5.11.00/root/bin/rootcint -f Dict.cxx -c
-DQT_VERSION=0x30000 -I/usr/lib/qt-3.3/mkspecs/default -I. -I"/include"
-I"/home/root/gcc/5.11.00/root/include" -I/usr/lib/qt-3.3/include
TMyQButton.h LinkDef.h
g++ -c -pipe -Wall -W -O2 -g -pipe -m32 -march=i386 -mtune=pentium4
-fPIC -DQT_NO_DEBUG -DQT_SHARED -DQT_THREAD_SUPPORT
-I/usr/lib/qt-3.3/mkspecs/default -I. -I"/include"
-I"/home/root/gcc/5.11.00/root/include" -I/usr/lib/qt-3.3/include -o
Dict.o Dict.cxx
rm -f libMyQButton.so.1.0.0 libMyQButton.so libMyQButton.so.1 libMyQButton.so.1.0
g++ -shared -Wl,-soname,libMyQButton.so.1 -o libMyQButton.so.1.0.0 TMyQButton.o Dict.o -L/usr/lib/qt-3.3/lib -L/lib -lGQt -lQtGui
-L/home/root/gcc/5.11.00/root/lib -lCore -lCint -lHist -lGraf -lGraf3d
-lGpad -lTree -lRint -lPostscript -lMatrix -lPhysics -lGui -pthread -lm
-ldl -rdynamic -lTable -lqt-mt

/usr/bin/ld: cannot find -lQtGui
collect2: ld returned 1 exit status
make: *** [libMyQButton.so.1.0.0] Error 1

I can omit -lQtGui from the last command and there are no errors, but I cannot load the created library into root. I have also searched for the libQtGui and it does not exist despite Qt being installed correctly.

Any help is appreciated.  

Thanks
Kerry Received on Thu Apr 20 2006 - 00:59:50 MEST

This archive was generated by hypermail 2.2.0 : Mon Jan 01 2007 - 16:31:58 MET