ubuntu 13.04 build QT develop env
2014-02-05 14:23
316 查看
1. install qt5
sudo apt-get install qt5-default qttools5-dev-tools
2. install g++
sudo apt-get install g++
3. install vim
sudo apt-get install vim
4. test:
4.1 mkdir hello_qt folder and create hello_qt.cpp file as follow :
#include <QApplication>
#include <QLabel>
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QLabel *label = new QLabel("Hello QT!");
label->show();
return app.exec();
}
4.2
qmake -project
4.3 add
QT += widgets
into hello_qt.pro file
4.4 qmake hello_qt.pro
4.5 make
4.6 run ./hello_qt
5. some informations:
error: invaliduse of incomplete type 'classQWebFrame'
error: forwarddeclaration of 'classQWebFrame'
在*.pro文件里添加:
QT += webkitwidgets
注意:当有QT+= webkitwidgets的时候,就不再需要QT += widgets
6. install QT4:
use the follow command to compile the code:
qmake-qt4 -project;
qmake-qt4 *.pro
make
sudo apt-get install qt5-default qttools5-dev-tools
2. install g++
sudo apt-get install g++
3. install vim
sudo apt-get install vim
4. test:
4.1 mkdir hello_qt folder and create hello_qt.cpp file as follow :
#include <QApplication>
#include <QLabel>
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QLabel *label = new QLabel("Hello QT!");
label->show();
return app.exec();
}
4.2
qmake -project
4.3 add
QT += widgets
into hello_qt.pro file
4.4 qmake hello_qt.pro
4.5 make
4.6 run ./hello_qt
5. some informations:
Qt4过渡至Qt5
QtWebKitWidgets也是一个独立的模块:
例如编译时错误
error: invaliduse of incomplete type 'classQWebFrame'error: forwarddeclaration of 'classQWebFrame'
解决办法:
在*.pro文件里添加:QT += webkitwidgets
注意:当有QT+= webkitwidgets的时候,就不再需要QT += widgets
6. install QT4:
sudo apt-get install libqt4-dev libqt4-dbg libqt4-gui libqt4-sql qt4-dev-tools qt4-doc qt4-designer qt4-qtconfig
use the follow command to compile the code:
qmake-qt4 -project;
qmake-qt4 *.pro
make
相关文章推荐
- how to build a cgal program in qt under ubuntu
- Ubuntu13.04环境下安装Qt5.1.1
- [Qt][ubuntu 13.04]setWindowFlags的使用
- [Qt][ubuntu 13.04]QSettings的使用
- ubuntu 12.04 yocto build Qt5.8.0 for imx6Q
- ubuntu13.04下安装Qt5.5.0
- 手把手教你安装QT集成开发环境(操作系统为ubuntu10.04,需要先安装build-essential和libncurses5-dev)
- Ubuntu 13.04 下安装配置Qt 5
- Ubuntu13.04打开Qt出现无法覆盖文件 /home/linux/.config/QtProject/qtcreator/qtversion.xml : Permission denied
- QT 5.4.1 for Android Ubuntu QtWebView Demo
- 在ubuntu13.04上安装Mac主题
- Install opencv-2.4.7 in Ubuntu 11.10 with Qt support
- ubuntu 13.04 64位系统无法使用802.1x的EAP认证上网解决办法
- [转]Ubuntu10.04下安装Qt4和创建第一个Qt程序
- ubuntu qt编译环境搭建
- Ubuntu 13.04 小米2S连接Eclipse真机调试
- Ubuntu下QT的安装详细教程
- Ubuntu环境QT出现:-1: error: cannot find -lGL(已解决)
- Ubuntu中Qt5.7.0的安装及opencv2.4.13配置
- ubuntu13.04添加桌面图标计算机回收站及应用图标