TQtWidget and libGQt.lib (unresolved symbol error)

Dear Rooters,

I am using Win2k, BNL QtRoot 5.18, Qt 4.4.0 and MSVS2005 as IDE.
When I want to use a TQtWidget I get this unresolved symbol message:

But the libGQt.lib is included. If I don’t use libGQt.lib I get one more error message:

My code is symply

int main(int argc, char **argv) { TQtWidget MyWidget; TGraph myGraph; QWidget myWidget; return 0; }

TGraph and QWidget don’t produce errors.
For me it looks as if libGQt.lib does not define TQtWidget completely. But I am more or less a beginner in C++.

Can someone solve this problem?

Thanks in advance
Axel

Please, try the shell script attached. (Download the latest version from root.bnl.gov/QtRoot/INSTALL_QTROOT.sh )

[code]#######################################################

This macro tries to install a complete ROOT + QT + QTROOT(cvs) + COIN3D

build environment.

Original instructions here: http://root.bnl.gov/QtRoot/How2Install4Unix.html

the COMPLETE stuff is installed in the current working directory.

so you can also test different versions if you feel adventurous…

you will need:

- curl and/or wget to download the Qt and ROOT files.

- svn to check out the Coin3D package

- cvs to check out the QtRoot package

you should read also ALL the various licenses.

about 100’ on a AMD 3800+, ~3 Gb disk space.

#######################################################

Author: L.Bardelli [ bardelli@fi.infn.it ]

#######################################################[/code]
It should build what you want .

It is to download and build the full-fledged versions of the several packages. They can be used:
[ul]- as the backend of the various ROOT plugin’s

  • directly “side-by-side” from within ROOT-based C++ code.
  • directly with no ROOT at all.[/ul]
    Namely, this “swiss-army knife” script does:
    [ul]1. ROOT 5.18 ( root.cern.ch )
  1. QtRoot ( root.bnl.gov )
  2. QGLViewer ( artis.imag.fr/Members/Gilles.Deb … r/examples )
  3. Qt 4.4.x ( trolltech.com/products/qt/ )
  4. Coin3D ( coin3d.org/ )[/ul]
    to create the objects like this root.bnl.gov/QtRoot/pictures/RootEarth.gif (attached)

The script is under developement.
The up-to-date version can be checked out from the CVS repository too

cvs -d :pserver:cvsuser@cvs.bnl.gov:/data01/CVS co  root/root.diff/qtUtil/INSTALL_QTROOT.sh


INSTALL_QTROOT.sh.txt (17.7 KB)

Dear Valeri,

thank you for answering.

There is no file attached.
I downloaded CVS and tried your command, but was not able to check out anything. I got this message:
cvs checkout: CVSROOT requires a path spec:
cvs checkout: :frowning:gserver|kserver|pserver):[[user][]@]host[:[port]]/path
cvs checkout: [:(ext|server):][[user]@]host[:]/path
cvs [checkout aborted]: Bad CVSROOT: ‘:pserver:cvsuser@cvs.bnl.gov’.

Can you attach the file?

What is the difference between using the file and installing root.bnl.gov/QtRoot/downloads/root.5.18.00.exe and building Qt 4.4.0 (with VC++2005 Express Edition)?

Greets,
Axel

Hello Axel,

[quote=“Axel_Muc”]There is no file attached.[/quote] :blush: Sorry, I am wondering if RootForum did no like the file “sh” extension. I added “.txt” and re-uploaded it. Please, download, remove the “.txt” extension then execute.

[quote=“Axel_Muc”]I downloaded CVS and tried your command, but was not able to check out anything. I got this message:
cvs checkout: CVSROOT requires a path spec:
[/quote]It sounds you made a typo ( or RootForum screw thing). Can you show your cvs command precisely as you typed it ?
By the way, to execute the script you do need your cygwin installation to include “cvs”, “svn”, and wget utilities. On the other hand, I highly recommend you to install the Win32 versions from tortoisesvn.tigris.org/ too[quote=“Axel_Muc”]Can you attach the file?[/quote]Yes, I have re-uploaded the file. Please check.

[quote=“Axel_Muc”]What is the difference between using the file and installing root.bnl.gov/QtRoot/downloads/root.5.18.00.exe and building Qt 4.4.0 (with VC++2005 Express Edition)?[/quote] root.5.18.00.exe is ready-to-use to use self-installed binary. One needs building (compiling , linking) nothing to use it. It is built and compiled against of Qt 3.3.7 rather Qt 4.4.0. It is self-sufficient. It does contain Qt 3.3.7 DLLs inside. However, it does NOT include Qt 3.3.7 development kit. By this reason you can execute it, but you cannot build your own Qt-based application (due Qt 3.x license constrain on Win32 platform).

To be able to create your own QtRoot program you do need to re-build everything from the scratch (Qt 4.4. binary for Win32 will be available with the next ROOT production release ) and you need very Qt 4.4.x and above. Very this Qt version is completely “free” for Win32 platform (The further information can be found on qtwin.sourceforge.net/qt3-win32/index.php ).

Please, take in account the QtRoot with Qt 4.x is still experimental. It may not work as smooth as Qt3-based one yet. Your bug (anticipated) reports, comments and contribution is always welcome and appreciated).

Hello Fine,

What I want to create is what the root manual calls “root-based Qt-application”. I just want to use Roots plotting and statistics capabilities.

So I downloaded the Qt4 self-installing exe (which is compiled with g++) and the BNL root.5.18.00.exe. After long error searching I realized that the g++ compiler does not work with the VC++ compiled BNL-Root libraries (I am not so experienced in C++). Therefore I took the Qt4 source and compiled it with VC++ on my own. So I am using VC++ instead of g++ now, which wasn’t my origninal intention, but works fine for Qt and seems to work for Root. Just the combination of Root and QT4 (by TQtWidget) makes problems. As you explained this is experimental and I understand that.
But I nontheless don’t want to go back to Qt3 (or better switch to, since Qt4 does not seem to be just a newer Qt3). As I saw the next Root production release is planned for June 25 and since I am just beginning I think I will wait for that. From then on I will test and report bugs. :wink:

CVS: I do not think it is a typo. Maybe I do not have the rights (in our network) to connect to this server. Maybe I try from my home PC.

So thank you again for your efforts!

Axel

Hello Axel,

[quote=“Axel_Muc”]What I want to create is what the root manual calls “root-based Qt-application”. I just want to use Roots plotting and statistics capabilities.[/quote]Yes I did understand this.

This is where your trouble came from. I did not use g++ I did use VC++

[quote=“Axel_Muc”]After long error searching [/quote]It was your mistake. You had to ask for “ROOT Support” earlier.

[quote=“Axel_Muc”]I realized that the g++ compiler does not work with the VC++ compiled BNL-Root libraries (I am not so experienced in C++).
Therefore I took the Qt4 source and compiled it with VC++ on my own. So I am using VC++ instead of g++ now,[/quote] Yes, it is the correct step.

[quote=“Axel_Muc”]which wasn’t my original intention, but works fine for Qt and seems to work for Root.[/quote] Yes, it should.

[quote=“Axel_Muc”] Just the combination of Root and QT4 (by TQtWidget) makes problems. As you explained this is experimental and I understand that.[/quote]No, it is not.

The experimental nature of the QtRoot with Qt4.4.x is NOT the source of your compilation / linking troubles.

You had to build QtRoot against of Qt 4.4.x. Did you do that? How? I think you did not build QtRoot against Qt properly (it does not matter which version Qt3 or Qt4). The shell script attached does show how this job should be done. It does job. There is another simpler script that does build just QtRoot for windows alone. (It is included into CVS repository too).

Qt4 is NOT just better Qt3. It is the new package. That means the code written for Qt4 cannot be compiled under Qt3 and versa verse. Qt3 is deprecated. It will NOT be supported by the next ROOT production release anyway.
Qt3 is not recommended for the new applications.

[quote=“Axel_Muc”] As I saw the next Root production release is planned for June 25 and since I am just beginning I think I will wait for that. From then on I will test and report bugs. :wink: [/quote] It is up to you. However, I do not think it is wise to wait at this point as soon as QtRoot for ROOT 5.20/0 + Qt 4.4 on Win32 is concern. There are a few Win32/VC++ nasty features you should take in account and learn anyway planning your activities. Here you are, with VC++ all libraries your application is going to use must be compiled consistently. That means, for example, ALL of them must be compiled with the “debug” option “on” or “debug” option “off”. You cannot mix easily the DLLs compiled with the “debug” option (for example Qt) and DLL compiled with no debug
For you, this means you have to recompile everythting YOURSELF anyway. This is neither Qt nor QtRoot feature, it is Win32/VC++ “nature” that you have to deal with as soon as you create any application for Windows.

Another issue to consider, I doubt CERN is going to produce the Windows distribution with any Qt plug-in.
On the other hand, I’ll be very busy during June, July with my collaboration (STAR ROOT production version 5.12 ) to test the ROOT 5.20 “production” release.
I used to wait 1 month at least before starting building my “binaries” anyway. Since the coming release is significantly different from the previous ones, I anticipate it is going to take an extra time to learn how to make the robust binary distribution for newest ROOT 5.20.

[quote=“Axel_Muc”]
CVS: I do not think it is a typo. Maybe I do not have the rights (in our network) to connect to this server. Maybe I try from my home PC.
Axel[/quote]I am wondering if you should define “http_proxy” environment variable to allow cvs communicating through firewall, see your sys-admin please) QtRoot is available as tar-ball too root.bnl.gov/QtRoot/downloads/qtFullRoot.tar.gz

Hello Valeri,

ok, there is a new information for me: one has to build against a special Version of Qt:

I did not build QtRoot. I used the selfinstalling exe.
Now I tried to understand what the script does, because I wanted to build QtRoot (against Qt 4.4) on my own - without script and without Cygwin(stupid?). But there seem to be several Windows specific Fixes in the script which I don’t want to do manually.

At the moment I don’t have time. But in two weeks I will try the script and then report my experiences.

Axel

[quote=“Axel_Muc”]ok, there is new information for me: one has to build against a special Version of Qt:[/quote] :unamused: No, it is not. One can use any :bulb: available Qt version 3.3.x and higher . What is special with very Qt 4.4.x - it is “free” on Windows platform with VC++ compiler.[quote=“Axel_Muc”]I did not build QtRoot. I used the selfinstalling exe.[/quote]What you had downloaded is the binary rather the source code installation. This installation was compiled against of Qt 3.3.7 and run-time environment of Qt 3.3.7 is included in to that selfinstalling exe[quote=“Axel_Muc”]Now I tried to understand what the script does, because I wanted to build QtRoot (against Qt 4.4) on my own[/quote]Yes, this is what the uploaded script does. It does build Qt 4.4.x also. You are recommended to build all packages together to make all builds consistent. One had told, this is Win32 VC++ feature; on Win32 platform one has to build the different packages consistently.
To avoid the guess job you are advised to use the script.

[quote=“Axel_Muc”] - without script and without Cygwin(stupid?). [/quote] You are correct . It is time-consuming to move on alone without the “GNU make” and “bash shell” from the Cygwin distribution assistance.
Before sinking in “without the script” business, please, use the script first , make sure the build works then … create your own way to build if you feel adventurous.[quote=“Axel_Muc”]But there seem to be several Windows specific Fixes in the script.[/quote] It is correct.[quote=“Axel_Muc”]which I don’t want to do manually.[/quote]Well, by some reason ROOT team@CERN incorporated the Qt-related fixes for X11 and did not adopt a few fixes needed to use the same Qt-plugin on Windows. You may want to ask them why :wink:

[quote=“Axel_Muc”]At the moment I don’t have time. But in two weeks I will try the script and then report my experiences.[/quote] It is up to you.
Please feel free asking me any question. Please do not fight your problems alone. Do not hesitate asking for a hand.