您的位置:首页 > 编程语言 > Qt开发

Ubuntu12.04 LTS 64位搭建QT4终端编译环境

2013-11-25 11:57 351 查看
在Ubuntu 12.04下采用apt-get的方法安装Qt4。

First: sudo apt-get install libqt4-dev libqt4-dbg libqt4-gui libqt4-sql qt4-dev-tools qt4-doc qt4-designer qt4-qtconfig

Second: 测试 个人实例

在桌面创建文件夹qt4hello(mkdir qt4hello)---> vim qthello.cpp --->输入:以下代码

#include <QApplication>
#include <QPushButton>
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QPushButton hello("Hello ubuntu12.04 LTS!");
hello.resize(190, 150);
hello.show();
return app.exec();
}
----> 保存(:wq)--->qmake -project(生成QT项目)--->qmake(生成makefile文件)--->make 出现以下代码

g++ -c -m64 -pipe -O2 -Wall -W -D_REENTRANT -DQT_WEBKIT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++-64 -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4 -I. -I. -o qthello.o qthello.cpp
g++ -m64 -Wl,-O1 -o qt4hello qthello.o    -L/usr/lib/x86_64-linux-gnu -lQtGui -lQtCore -lpthread
--->./qt4hello(文件夹的名称)
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐