LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-06-2009, 06:35 AM   #1
wagmare
Member
 
Registered: Jan 2009
Posts: 62

Rep: Reputation: 15
how to differentiate two versions of qt


hi friends,
i am currently working on qt4.4.3 and today i download the qt4.5 source and compile it..
i need to export the path i will do in bashrc ..
but the problem is how can i differentiate these two bin/ files
if designer means this qt4.4.3 will be replaced by qt4.5 ..
how can i overcome ... which things i need to rename and export ...


if i change /bin/moc to moc_4.5 will it give any problem aaa . ?
please help me ...
 
Old 03-06-2009, 07:13 AM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 11,889

Rep: Reputation: 1608Reputation: 1608Reputation: 1608Reputation: 1608Reputation: 1608Reputation: 1608Reputation: 1608Reputation: 1608Reputation: 1608Reputation: 1608Reputation: 1608
Quote:
i am currently working on qt4.4.3 and today i download the qt4.5 source and compile it..
How did you install qt4.5? If you used just ./configure then by default it installs in /usr/local/Trolltech/Qt-4.5.0 and nothing is ovewritten. If you have used the same prefix as in the qt4.4.3 installation, then qt4.5 has ovewrite previous version.
 
Old 03-06-2009, 08:17 AM   #3
wagmare
Member
 
Registered: Jan 2009
Posts: 62

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by bathory View Post
How did you install qt4.5? If you used just ./configure then by default it installs in /usr/local/Trolltech/Qt-4.5.0 and nothing is ovewritten. If you have used the same prefix as in the qt4.4.3 installation, then qt4.5 has ovewrite previous version.
thanks for reply ....
no it created a new path /usr/local/Trolltech/qt4.5.0
/usr/local/Trolltech/qt4.4.3 is my prev path


in .bash_profile file i include
PATH=$PATH:$HOME/bin:/usr/local/Trolltech/Qt-4.4.3/bin
export the PATH

now how to add this new path in different name is my question .. please help ...
 
Old 03-06-2009, 08:39 AM   #4
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 11,889

Rep: Reputation: 1608Reputation: 1608Reputation: 1608Reputation: 1608Reputation: 1608Reputation: 1608Reputation: 1608Reputation: 1608Reputation: 1608Reputation: 1608Reputation: 1608
If you want the qt default to be version 4.5 edit the PATH and use:
Code:
PATH=/usr/local/Trolltech/qt4.5.0/bin:$PATH:$HOME/bin
so the command for 4.5 take precedence, from those in /usr/bin for example.
If you want to have also the previous qt commands available, you can create another .bash_profile (name it .bash_profile-4.4.3) customized for the qt4.4.3. When you want to use qt4.4.3, run before anything else:
Code:
source .bash_profile-4.4.3

Last edited by bathory; 03-09-2009 at 09:22 AM.
 
Old 03-06-2009, 10:10 AM   #5
norobro
Member
 
Registered: Feb 2006
Distribution: Debian Sid
Posts: 695

Rep: Reputation: 275Reputation: 275Reputation: 275
Perhaps less elegant than barhory's solution, this is how I handle two versions of qt:

I have qt 3.3.8, for xconfig, and qt 4.4.0 on a separate partition on my machine. I have the QTDIR environment variable set to '/usr/local/qt' and then in that directory I have a soft link to the version of qt that I want to use:
Code:
norm  /usr/local: l
. . .
lrwxrwxrwx  1 root staff   30 2009-02-27 14:06 qt -> /b11/qt-x11-opensource-src-4.4.0
lrwxrwxrwx  1 root staff   21 2009-02-01 12:24 qt3 -> /b11/qt-x11-free-3.3.8/
lrwxrwxrwx  1 norm staff   30 2008-07-15 16:48 qt4.4 -> /b11/qt-x11-opensource-src-4.4.0
. . .
I program with 4.4.0 so when I need to configure the kernel I do:
Code:
norm  /usr/local: rm qt
norm  /usr/local: cp qt3 qt
Norm
 
Old 03-09-2009, 08:52 AM   #6
wagmare
Member
 
Registered: Jan 2009
Posts: 62

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by bathory View Post
If you want the qt default to be version 4.5 edit the PATH and use:
Code:
PATH=/usr/local/Trolltech/Qt-4.4.3/bin:$PATH:$HOME/bin
so the command for 4.5 take precedence, from those in /usr/bin for example.
If you want to have also the previous qt commands available, you can create another .bash_profile (name it .bash_profile-4.4.3) customized for the qt4.4.3. When you want to use qt4.4.3, run before anything else:
Code:
source .bash_profile-4.4.3
thanks for reply ...
i try this method .. changing the PATH in .bash_profile is working fine ... its changing the bin value .. only when i logout ..
i copied the .bash_profile to .bash_profile-4.4.3
doing
Code:
source .bash_profile-4.4.3
its not working ... same designer path is running ...
 
Old 03-09-2009, 09:22 AM   #7
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 11,889

Rep: Reputation: 1608Reputation: 1608Reputation: 1608Reputation: 1608Reputation: 1608Reputation: 1608Reputation: 1608Reputation: 1608Reputation: 1608Reputation: 1608Reputation: 1608
My fault. I meant that in your .bash_profile (the one you want to use as default) you should use the path to qt4.5, but in the example I've used the path to qt4.4.3 (already corrected in the previous post). So the correct PATH is:
Code:
PATH=/usr/local/Trolltech/qt4.5.0/bin:$PATH:$HOME/bin
Then you can copy this .bash_profile to .bash_profile-4.4.3 and change the PATH to be:
Code:
PATH=/usr/local/Trolltech/qt4.4.3/bin:$PATH:$HOME/bin
When you login you use the default .bash_proflie so you can use qt4.5 and when you want to use qt4.4.3 you run "source .bash_profile-4.4.3" to change qt.

Regards
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
differentiate text files packets Programming 3 01-30-2008 09:40 PM
how to differentiate virtual desktops? eublade Linux - Desktop 4 08-13-2007 11:05 PM
differentiate poweroff from halt ric Slackware 6 07-25-2006 08:04 PM
how differentiate two Disk SCSI on 2 controllers? xcore_on Linux - Newbie 5 04-02-2006 05:36 PM
how to differentiate processes ugp Programming 5 03-03-2006 12:45 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:11 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration