Failure to open file: /usr/lib/qt4/examples/dialogs/tabdialog/Makefile

随便打开一个qt demo 编译发现报错

Running build steps for project tabdialog...
Starting: /usr/bin/qmake-qt4 /usr/lib/qt4/examples/dialogs/tabdialog/tabdialog.pro -spec /usr/share/qt4/mkspecs/linux-g++ -r CONFIG+=debug

Failure to open file: /usr/lib/qt4/examples/dialogs/tabdialog/Makefile
Unable to generate makefile for: /usr/lib/qt4/examples/dialogs/tabdialog/tabdialog.pro
Exited with code 5.
Error while building project tabdialog
When executing build step 'QMake'


看起来是不能生成makefile,应该是权限问题,这些demo位于
/usr/lib/qt4/examples/
于是试了试拷贝了一份到我的用户目录,同样编译有错误
于是乎sudo qtcreator启动,这回编译运行都没问题了,看来必须用root才可以?
这时候又用当前用户 qtcreator新建一个qt gui工程编译运行却都正常
这是才想起看了以下目录的所有权
ls -lh /home/applee/qt/examples

drwxr-xr-x 3 root root 4.0K 2010-03-23 21:20 assistant
drwxr-xr-x 7 root root 4.0K 2010-03-23 21:20 dbus
drwxr-xr-x 9 root root 4.0K 2010-03-23 21:20 designer
drwxr-xr-x 4 root root 4.0K 2010-03-23 21:20 desktop
drwxr-xr-x 10 root root 4.0K 2010-03-23 21:20 dialogs
drwxr-xr-x 8 root root 4.0K 2010-03-23 21:20 draganddrop

果然都是所属root组root用户的,于是修改了下
sudo chown -R applee /home/applee/qt/examples

这时再用我的用户编译那些examples都没问题了 over

你可能感兴趣的:(File,Build,qt,makefile,2010)