PDA

View Full Version : Compiling QT-2.3.2 with gcc3 (a guide)



fryfrog
12-19-2001, 09:16 AM
i posted this on the hackersquest.gomp.ch forums, and thought i would go ahead and post the same thread here for the... heck of it? :)

i just got finished compiling qt-2.3.2 using gcc3 with the help of fee and and a few others from #showeq and thought i would post how we did it on the forums, in case someone else needed help. for me, the hard part wasn't compiling it... it was getting it to use gcc3 instead of 2.96. this is all on redhat 7.2, so if you use a different version/distro... this might not work for you.
start off by downloading the qt-2.3.2 source (maybe you want to grab 3.0.1 while you are there too). you can get it at ftp.trolltech.com (in /qt/source/qt-x11-2.3.2.tar.gz).

next step is to extract this, using "tar zxvf qt-x11-2.3.2.tar.gz". you can then move the dir where ever you want. i use /lib/qt-2.3.2 since that is where redhat put qt-2.3.1. i also keep qt-3.0.1 there. once it is there, edit the file "./configs/linux-g++-shared" and change all references to "gcc" and "g++" to "gcc3" and "g++3" respectivly. this assumes you HAVE the gcc3 and g++3 rpms installed (i think it is a default on rh 7.2)

the lines are:
line 3: "SYSCONF_CXX = g++3"
line 4: "SYSCONF_CC = gcc3"
line 35: "SYSCONF_LINK = g++3"

once you have done this, you will need to "export QTDIR=/path/to/qt-2.3.2" and then run "./configure -thread". this should run through for a little bit, asking you to type "yes" at the beginning.

now comes the compile. i would recommend doing this in a screen because it WILL take 2+ hours and if you are doing it from telnet/ssh and your connection goofs, it will cancel your compile. you can use "make -j3" if you have a dual cpu system, and halve compile times.

once you have compiled QT-2.3.2, you might consider adding it to your /etc/ld.so.conf (/usr/lib/qt-2.3.2/lib is my entry) then running "ldconfig"

this (i think) should get your qt-2.3.2 compiled with gcc3, which gets you half way ready for the battle. to compile apps with gcc3 that use qt, you need to compile anything it uses with gcc3 as well (hence compiling qt-2.3.2 with gcc3).

another trick for getting gcc3 to be used can be to use "export CC=gcc3" and "export CXX=g++3"

SeqTester
12-19-2001, 09:47 AM
All I did was install new QT then mv the old dir and mv the new one to the old ones place, then rebooted But that was last round.

I reinstalled RedHat7.2 and Everything was there and worked fine. I think it installed QT 2.3.1 I not 100% sure righ tnow I am at work, but everythign was there.

Just an Idea!!