PDA

View Full Version : How to set paths?



hoborg
21st February 2006, 21:10
Hi, I just downloaded the source of qt-4.1.0 for my X11.
After that, I compiled it with make && make install. The new installation is now in /usr/local/Trolltech/Qt-4.1.0/ but there is still qt 3.3 remaining in /usr/local/qt/3/
I tried to change PATH and other variables in /etc/env.d but I just got stuck, is there no way to do it automatically?

yop
21st February 2006, 21:14
export PATH=/usr/local/Trolltech/Qt-4.1.0/bin:$PATH
export QTDIR=/usr/local/Trolltech/Qt-4.1.0

You can also add the two lines above in your /etc/profile

hoborg
21st February 2006, 21:34
Thanks, I did that, but I think that I there is something more messed up.
After I downloaded, for example k3b (cd/dvd burning software) sources and launched the ./configure, I get something like this:

checking for Qt... configure: error: Qt (>= Qt 3.0.3) (headers and libraries) not found. Please check your installation!

yop
21st February 2006, 21:38
Then revert back to your original Qt installation:
echo $PATH
echo $QTDIR
and then post your results. k3b is written in Qt 3 so you shouldn't have the path to the Qt 4 installation in front/before your Qt 3 installation in your PATH env var and QTDIR should point to your Qt 3 installation as well.

hoborg
21st February 2006, 21:43
Fine, I could install k3b then but when I set the paths back to qt 3, the 'qmake' command would point to the older version of qmake, am I right?

yop
21st February 2006, 21:45
Fine, I could install k3b then but when I set the paths back to qt 3, the 'qmake' command would point to the older version of qmake, am I right?
That's right

hoborg
21st February 2006, 22:15
So this is pointless because I installed Qt 4 to develop applications in this enviroment... let's say it that way: I want to get rid of qt 3 and I want my newly installed qt 4 to stay as The-Chosen-One ;)
Could you tell me how to do this?

p.s. I just noticed the 'installation' section so this thread is in kinda wrong place, sorry for that...

michel
21st February 2006, 23:22
So this is pointless because I installed Qt 4 to develop applications in this enviroment... let's say it that way: I want to get rid of qt 3 and I want my newly installed qt 4 to stay as The-Chosen-One ;)
Could you tell me how to do this?

p.s. I just noticed the 'installation' section so this thread is in kinda wrong place, sorry for that...

Once the program you are trying to build is installed, you can set the variables back to point to Qt4. They will only need them while compiling. I had this problem with a few KDE programs recently because they wanted to use the qt tools from Qt3, which I deleted shortly after installing Qt4.

My ~/.profile looks something like this:

#QMAKESPEC=/usr/local/share/Qt/mkspecs/freebsd-g++; export
QMAKESPEC=/usr/local/Trolltech/Qt-4.1.0/mkspecs/freebsd-g++; export QMAKESPEC
#QTDIR=/usr/X11R6; export QTDIR
QTDIR=/usr/local/Trolltech/Qt-4.1.0; export QTDIR
PATH=$PATH:$QTDIR/bin

The commented out lines are the Qt3 locations. That way if I need to install something that uses Qt3, I can quickly comment out the second version and uncomment the first, login on another terminal, and then after it's done I can change everything back. It's probably not a good idea to get rid of your Qt3 distribution entirely until all of the programs you like to use switch over to 4. Unless of course you can't spare the space.

Of course, if you only ever plan to program while in X, you can just get away with putting the lines in .bashrc (if you use bash) and reopening your Konsole/xterm/whatever session. I have these lines in my wife's .bashrc file because sometimes she's downloading something with BitTorrent so I can't log her out to work and have to use an xterm :(

But note that they won't work when you close X, because afaik .bashrc is only used by non-login instances of the shell. Well, I guess you could get it to work outside of X, but you know what I mean.

btw I just noticed I am no longer "Junior Member." Hooray! :D :D

hoborg
22nd February 2006, 11:19
Ok, everything works fine. I also had to take care of the LDPATH but it's ok now. Thanks a lot :)

impeteperry
24th February 2006, 16:21
Hi michel
I am try to do as you suggest
My ~/.profile looks something like this:

#QMAKESPEC=/usr/local/share/Qt/mkspecs/freebsd-g++; export
QMAKESPEC=/usr/local/Trolltech/Qt-4.1.0/mkspecs/freebsd-g++; export QMAKESPEC
#QTDIR=/usr/X11R6; export QTDIR
QTDIR=/usr/local/Trolltech/Qt-4.1.0; export QTDIR
PATH=$PATH:$QTDIR/binBut I can't find where this profile is. I did a "find Files/Folders" search on "*.profile*" and got a whole bunch, but none of them looked like yours. I think I have installed Qt4 correctlly. i have "Qt-4.1.1" in my "usr/local/Trolltect" directory and all the examples and demos run ok', but I can't compile any of them as you can see.
pete@newCompaq:~/qt4/analogClock$ qmake -project
pete@newCompaq:~/qt4/analogClock$ qmake analogclock.pro
Error processing project file: /home/pete/qt4/analogClock/analogclock.pro
pete@newCompaq:~/qt4/analogClock$

Any suggestion?
thanks
pete

jacek
24th February 2006, 16:54
pete@newCompaq:~/qt4/analogClock$ qmake -project
pete@newCompaq:~/qt4/analogClock$ qmake analogclock.pro
Error processing project file: /home/pete/qt4/analogClock/analogclock.pro
Any suggestion?
Have you tried "qmake" or "qmake analogClock.pro"?

yop
24th February 2006, 19:08
...But I can't find where this profile is... It's in /etc/profile. Take a look at the end of the script to see what else it runs (in Suse you should put your changes in /etc/profile.local for example)
...I can't compile any of them as you can see...
Any suggestion?jacek has a good one ;)