LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   want to set PATH for qt and having trouble (https://www.linuxquestions.org/questions/linux-newbie-8/want-to-set-path-for-qt-and-having-trouble-830472/)

rhklinux 09-05-2010 10:51 AM

want to set PATH for qt and having trouble
 
Hi i am a newbie !!
I have bash
I installed Qt libs and want to set environmental variable PATH, I tried some stuff from qt tutorials..
here is what i tried:
Code:

In .profile added the following lines:
 PATH=/path of bin:$PATH
 export PATH

and it does nothing
so i tried
Code:

PATH=$PATH:/usr/local/qt-everywhere-opensource-src-4.6.3/bin
then checked path
Code:

echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/qt-everywhere-opensource-src-4.6.3/bin

Now there are two issues
1) the make gives error that header not found( probably make don't have the path)

2) when i closed the terminal and opened it again the PATH I newly entered was not there !!

thanks in advance !!!

ofaring 09-05-2010 12:04 PM

1 Attachment(s)
I would suggest that you try placing
Code:

PATH="/path of bin:$PATH"
export PATH

in "~/.bashrc".

Make sure that your .profile includes something to this affect:
Code:

# if running bash
if [ -n "$BASH_VERSION" ]; then
    # include .bashrc if it exists
    if [ -f "$HOME/.bashrc" ]; then
        . "$HOME/.bashrc"
    fi
fi

No doubt Ubuntu has setup their login process to be different from Debian, but this should work. If not, and it's a single-user computer, try placing the path in /etc/profile. Mine is set up like the following, but you should pay attention to how Ubuntu has structured things.
Code:

if [ "`id -u`" -eq 0 ]; then
  PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
else
  PATH="/usr/local/bin:/usr/bin:/bin:/usr/games:$HOME/bin"
fi
export PATH

The reason your PATH change set through the cmd line didn't stay after restarting the terminal, is because changes made in that way will only stay in that session.

As for the make procedure, I haven't built Qt from source, so there you will have to check further into their documentation, but if there is a configure step, e.g.
Code:

$ configure --bin-directory=DIR --your-chosen switches
See whether you can utilise that method (Type
Code:

./configure --help
from the top-level source code directory.)

If I understand what you're trying to do with Qt, (You may be duplicating effort, but it's fun to experiment. :)) you might also find the attached text file useful. It's info I compiled from various sources some time back. While it doesn't apply exactly to your situation, I suspect that the issue I had to overcome may be the same as what you're trying to do now. One thing I would add is, don't overwrite existing PATHs. Before making changes, check the output of
Code:

echo $VARIABLE_YOU_ARE_LOOKING_FOR
If nothing pops up, you're good. As you already know, otherwise be sure to add the original path in
Code:

$ export "$PATH:$NEW_PATH"
Good Luck!!

Kenny_Strawn 09-05-2010 12:07 PM

You might also want to post the contents of PKG_CONFIG_PATH:

Code:

echo $PKG_CONFIG_PATH
This is where pkg-config (which make depends on) looks for the required headers and libraries.

rhklinux 09-05-2010 02:16 PM

firstly thanks all !!
Unfortunately what ofaring said is not working , nothing is happening and path is still the same !!
is there any alternative way to install Qt automatically (like using synaptic)
is there any .deb package of Qt available which will perform the tasks such as setting the environmental variables etc.


All times are GMT -5. The time now is 03:18 AM.