最近安装qt-x11-2.3.2,文件存储路径为/usr/qtopia/qt-2.3.2,我用的操作系统是Ubuntu8.04,设置好环境变量,诸如QTDIR,可是在执行命令:./configure -no-opengl时总是出现如下错误:
strive@strive-laptop:/usr/qtopia/qt-2.3.2$ ./configure -no-opengl
touch: cannot touch `.test.qt.': Permission denied
rm: cannot remove `.test.qt.': No such file or directory
The environment variable $QTDIR is not set correctly. It is currently
set to "/usr/qtopia/qt-2.3.2", but it should be set to this directory,
which is "/usr/qtopia/qt-2.3.2".
Please read the INSTALL file for instructions on how to set $QTDIR
correctly. If you have set $QTDIR in your .profile or .login, you
will need to log out and log in again to make the setting effective.
通过错误提示认为是因为自己权限不够,于是执行如下命令:
strive@strive-laptop:/usr/qtopia/qt-2.3.2$ sudo ./configure -no-opengl
[sudo] password for strive:
The environment variable $QTDIR is not set correctly. It is currently
set to "", but it should be set to this directory,
which is "/usr/qtopia/qt-2.3.2".
Please read the INSTALL file for instructions on how to set $QTDIR
correctly. If you have set $QTDIR in your .profile or .login, you
will need to log out and log in again to make the setting effective.
显然依然不可以,网上搜索未果。
后来发现可以如此解决:
首先,启用ROOT用户:$sudo passwd root
这样设置ROOT密码,然后执行如下命令:su
切换到ROOT用户,然后再以root身份设置QTDIR环境变量即可!