LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 03-28-2004, 10:35 PM   #1
zombyLINUX
LQ Newbie
 
Registered: Mar 2004
Distribution: SuSE 9.0 KDE 3.1
Posts: 26

Rep: Reputation: 15
QTDIR Environment Variable problem


I have installed qt3 on my laptop machine running SuSE 9.0 with KDE 3.1
windowmanager.

I have a simple project in a direatory called QtWindowWithButtons that
just makes a Qt window with three buttons.

I am able to run qmake and when i run make it cannot find the header
files. This is of course is an include problem. I know that Qt Makefiles
use a QTDIR environment that specifies qt directory...in my case being
/usr/lib/qt3. However, if i say QTDIR=/usr/lib/qt3 and then echo $QTDIR
in Konsole, I get /usr/lib/qt3. This is as expected, but when i type
qmake, then make it uses /include instead of /usr/lib/qt3/include.

This is because i forgot to export QTDIR.

So I did that and it worked fine, however when I reboot of course the environment variable is no longer set. I guess my qeustion is, is there a way to permanently set environment variables. I know that I can modify my .bashrc file to set it whenever I open up a Konsole. But on system boot up, is there like a registry that I can change to set an environment variable. Like the Windows Registry???

Please provide any advice on this matter...
 
Old 03-28-2004, 11:06 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Quote:
/etc/profile.d/qt.sh
Code:
#!/bin/sh
# Environment variables for the Qt package:
if [ -d /usr/lib/qt3 ]; then
  QTDIR=/usr/lib/qt3
else
  exit
fi
if [ ! "$CPLUS_INCLUDE_PATH" = "" ]; then
  CPLUS_INCLUDE_PATH=$QTDIR/include:$CPLUS_INCLUDE_PATH
else
  CPLUS_INCLUDE_PATH=$QTDIR/include
fi
MANPATH="$MANPATH:$QTDIR/doc/man"
PATH="$PATH:$QTDIR/bin"
export QTDIR
export CPLUS_INCLUDE_PATH
export MANPATH
 
Old 03-29-2004, 12:26 AM   #3
zombyLINUX
LQ Newbie
 
Registered: Mar 2004
Distribution: SuSE 9.0 KDE 3.1
Posts: 26

Original Poster
Rep: Reputation: 15
QTDIR problem still exists...

I had to create the qt.sh file and put it in that directory. Do I need to set up some link to source that shell script when my machine boots. Because I rebooted and no QTDIR was defined. I tested using echo $QTDIR. Maybe I am just missing something...
 
Old 03-29-2004, 02:13 AM   #4
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
You'd have to make it executable ...

Code:
# Append any additional sh scripts found in /etc/profile.d/:
for file in /etc/profile.d/*.sh ; do
  if [ -x $file ]; then
    . $file
  fi
done
This is how the files in /etc/profile.d get started...
if it's executable it'll be run for any shell.


Cheers,
Tink
 
  


Reply



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
Problem withChanging DISPLAY environment variable to display on someone else's screen wantsri Linux - Networking 1 10-25-2005 11:14 AM
environment variable gamor Linux - Newbie 4 04-30-2005 05:28 PM
Environment Variable salmanucit Linux - Software 2 07-21-2004 02:27 AM
environment variable mimi Linux - Newbie 1 04-10-2002 08:29 AM
environment variable mimi Linux - General 2 04-10-2002 07:45 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:44 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
Open Source Consulting | Domain Registration