歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> Linux教程 >> Linux QT環境變量設置

Linux QT環境變量設置

日期:2017/2/28 16:36:03   编辑:Linux教程

我的qt是4.5.1,一切按默認進行,默認安裝路徑:/usr/local/Trolltech/Qt-4.5.1

打開/etc/profile文件(sudo gedit /etc/profile),

終端輸入:

sudo gedit /etc/profile //或者: sudo vim /etc/profile

在該文件的末尾加上以下語句:

export PATH=/usr/local/Trolltech/Qt-4.5.1/bin:$PATH

export QTDIR=/usr/local/Trolltech/Qt-4.5.1

export MANPATH=$QTDIR/man:$MANPATH

export LD_LIBRARY_PATH=$QTDIR/lib:$LD_LIBRARY_PATH

保存後重啟。

另外:網上有的帖子說home目錄下你的名字文件夾的.profile 啊,或者etc/bash.bashrc啊 等等好多個版本,我試過了反正是都沒有效果,就只有上面那種可行,成功後很高興,給後來者分享下,免得走彎路。

Copyright © Linux教程網 All Rights Reserved