1,在终端下输入:
sudo apt-get install libqt4-dev libqt4-dbg libqt4-gui libqt4-sql qt4-dev-tools qt4-doc qt4-designer qt4-qtconfig qtcreator
2,qt测试代码,helloworld.cpp
-
/**********************************************
-
-
Copyright:Hufutech
-
-
Author: zhangjinxin
-
-
Date:2015-09-25
-
-
Description:Test qt
-
-
**********************************************/
-
-
#include <QApplication>
-
#include <QLabel>
-
-
int main(int argc, char *argv[]) {
-
-
QApplication app(argc, argv);
-
-
QLabel label = QLabel("Hello World!");
-
label.show();
-
-
return app.exec();
-
-
}
-
3,测试步骤
qmake -project
qmake
make
问题: fatal error: QApplication: No such file or directory
解决: 在helloworld.pro 中加入QT += widgets
./helloworld
阅读(918) | 评论(0) | 转发(0) |