Help - Search - Members - Calendar
Full Version: Installing Qt4
MandrivaUsers.org > Advanced Topics > Command Line, Kernel and Programming
grimx
Using Mandriva 07

I have Qt3 already installed, and i just downloaded Qt4.3 from Trolltech.com.
I alread unpacked the .gz file.
Now do i just install it even though Qt3 is already there
or do i uninstall Qt3 before hand????


[moved from Software by spinynorman]
neddie
It's much easier to install using urpmi, is there a reason you particularly need that gz version?

I'm pretty sure both sets of development tools will sit happily side-by-side, but if it was me I'd uninstall the qt3-devel stuff just to be sure of what's going on. Don't try and uninstall qt3 though, because lots of apps rely on it wink.gif
scarecrow
Yeah, why not "urpmi qt4-common"
You may need some other qt4 packages for your needs.
Sometimes you may have to compile from source, but this is unlikely for things like gtk and qt: they are included in every distro out there right out of the box.
tyme
if you're using a KDE version prior to 4 you need QT3, I believe. KDE3.x and below will not run on QT4.
scarecrow
QUOTE (tyme @ Jan 25 2008, 07:51 PM) *
if you're using a KDE version prior to 4 you need QT3, c believe. KDE3.x and below will not run on QT4.


he already has QT3 installed if he's running KDE3.x - so my guess is he wants to install QT4.
QT4 can coexist with QT3 perfectly well... you just have to switch environment profiles whenever you want to compile something using a specific QT version.
Greg2
We need to know what version 'exactly', you d/l from Trolltech? What do you want to do with it? In any case, you (as has already been noted) can have both versions (libs & devel) sit happily side-by-side. smile.gif I have three versions on my dev box, with KDE.

So what version (Commercial, Open Source), what for (desktop, embedded, phone)?
grimx
On Mandriva 07
KDE 3.5
i have installed
Qt3.3.6 (devel, common, libqt3) -18mdv2007.0

I downloaded
qt-X11-opensource-src-4.3.3.tar.gz

using just for gui programming

i ran .cofigure and then make and then ( su -c "make install") and so on, to build and install it.
but qtdemo exe does not work
and it wont compile Qt4 apps but it will compile Qt3 apps.
and Qt4 does not show up in MCC installed programs section.

Help
grimx
my env var QTDIR = /usr/lib/qt3
my PATH includes the Qt4 path
fredstah
QUOTE (grimx @ Jan 28 2008, 07:53 PM) *
my env var QTDIR = /usr/lib/qt3
my PATH includes the Qt4 path

For Qt4 apps, your QTDIR should be set to your Qt4 install path.
grimx
meaning /usr/lib/qt4
grimx
do i leave the Qt3 entries that are in the PATH var
the qt3 entries come after the qt4 entries
Greg2
Unless you did ./configure with the -prefix-install option, you have probably installed in /usr/local/Trolltech/Qt-4.3.3/. If that is the case, you will have to set your environment $PATH accordingly.

You have qt4.1.4 available in your 2007 repos. Do you need qt4.3.3? I'm just curios.
grimx
my PATH includes the qt3 entries plus ( /usr/local/Trolltech/Qt-4.3.3/)
i do have that qt4.1 repo
grimx
the reason y i downloaded qt4 .tar.gz is because my DSL line is down
so i had to use my friends Window box to download it
grimx
so as long as my PATH and QTDIR are set to Qt4 values
it should work then??

well if does'nt
i'll be back tomarrow
Greg2
QUOTE (grimx @ Jan 28 2008, 04:28 PM) *
so as long as my PATH and QTDIR are set to Qt4 values
it should work then??

Yes, that is correct.
grimx
ok thanx
grimx
Well when i put /usr/lib/qt4 as QTDIR; qt4 and qt3 do not compile
when i set QTDIR to /usr/lib/qt3 only qt3 compiles
and my PATH does include /usr/local/Trolltech/Qt-4.3.3/bin
/usr/lib/qt3 etc..... shows up three times in my PATH var,
and i don't know y
Help
Greg2
QUOTE (grimx @ Jan 29 2008, 04:47 PM) *
Well when i put /usr/lib/qt4 as QTDIR; qt4 and qt3 do not compile

You don't/shouldn't have a /usr/lib/qt4, unless you have installed something from the repos. Because you chose to use the default install with ./configure.
For now you can simply do
CODE
PATH=$PATH:/usr/local/Trolltech/Qt-4.3.3/bin
then do
CODE
echo $PATH
to see what you have.
Then do
CODE
export QTDIR=/usr/local/Trolltech/Qt-4.3.3
then do
CODE
echo $QTDIR
to check that. If everything looks good, using the same terminal session, go to work with qt4.
It would make it easier for you if you renamed the Qt-4.3.3 directory to qt4.

I wouldn't suggest placing the 'export QTDIR' in your bash_profile, because it 'may' screw up your KDE desktop, however I'm not positive about this.
grimx
Greg2:

After setting up my env vars to this
PATH=$PATH:/usr/local/Trolltech/Qt-4.3.3/bin
export QTDIR=/usr/local/Trolltech/Qt-4.3.3
and in checking them they show up, fine


when i try to compile this source code with
qmake -project
qmake
make
//////////////////////////
#include <QApplication>
#include <QPushButton>

int main(int argc, char *argv[])
{
QApplication app(argc, argv);

QPushButton hello("Hello World");
hello.resize(100, 30);
hello.show();
return app.exec();
}
///////////////////////////

it get this error:

g++ -c -pipe -Wall -W -O2 -DQT_NO_DEBUG -I/usr/lib/qt3/mkspecs/default -I. -I. -I/usr/local/Trolltech/Qt-4.3.3/include -o FIRST.o FIRST.cpp
cc1plus: error: /usr/local/Trolltech/Qt-4.3.3/include: Permission denied
make: *** [FIRST.o] Error 1

so i tried changing owner and group on /usr/local/Trolltech/Qt-4.3.3/include
and /usr/local/Trolltech
and /usr/local/Trolltech/Qt-4.3.3
to "mylogin name"
because they all have (owner = root) (group = root) on those as well"
and try to recompile i get this

g++ -c -pipe -Wall -W -O2 -DQT_NO_DEBUG -I/usr/lib/qt3/mkspecs/default -I. -I. -I/usr/local/Trolltech/Qt-4.3.3/include -o FIRST.o FIRST.cpp
FIRST.cpp:1:24: error: QApplication: No such file or directory
FIRST.cpp:2:23: error: QPushButton: No such file or directory
FIRST.cpp: In function ‘int main(int, char**)’:
FIRST.cpp:6: error: ‘QApplication’ was not declared in this scope
FIRST.cpp:6: error: expected `;' before ‘app’
FIRST.cpp:8: error: ‘QPushButton’ was not declared in this scope
FIRST.cpp:8: error: expected `;' before ‘hello’
FIRST.cpp:9: error: ‘hello’ was not declared in this scope
FIRST.cpp:11: error: ‘app’ was not declared in this scope
FIRST.cpp: At global scope:
FIRST.cpp:4: warning: unused parameter ‘argc’
FIRST.cpp:4: warning: unused parameter ‘argv’
make: *** [FIRST.o] Error 1
Greg2
QUOTE (grimx @ Jan 31 2008, 02:20 PM) *
it get this error:

g++ -c -pipe -Wall -W -O2 -DQT_NO_DEBUG -I/usr/lib/qt3/mkspecs/default

You are tying to use qt3/mkspecs/default/(qt/qmake.conf-3.3.8), and it 'will not work' with qt4.

I would suggest that you check out the Trolltech/Qt tutorials and their forums for more info on this. I'm very sorry, but I do not have the time or skill to try to teach Qt programming here... I still use their documentation for my needs. smile.gif
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.