LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   how to differentiate two versions of qt (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-differentiate-two-versions-of-qt-709593/)

wagmare 03-06-2009 05:35 AM

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 ...

bathory 03-06-2009 06:13 AM

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.

wagmare 03-06-2009 07:17 AM

Quote:

Originally Posted by bathory (Post 3466766)
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 ...

bathory 03-06-2009 07:39 AM

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

norobro 03-06-2009 09:10 AM

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

wagmare 03-09-2009 07:52 AM

Quote:

Originally Posted by bathory (Post 3466843)
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 ...

bathory 03-09-2009 08:22 AM

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


All times are GMT -5. The time now is 01:44 PM.