Welcome 微信登录

首页 / 操作系统 / Linux / Ubuntu 12.04 LTS 64位搭建Qt4终端编译环境

在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-qtconfigSecond: 测试  个人实例在桌面创建文件夹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(文件夹的名称)Qt 的详细介绍:请点这里
Qt 的下载地址:请点这里推荐阅读:Ubuntu 环境下Gtk与QT编译环境安装与配置 http://www.linuxidc.com/Linux/2013-08/88539.htmLinux系统下QT环境搭建 http://www.linuxidc.com/Linux/2013-07/87576.htmUbuntu下QT控制台程序无法运行的解决方案以及XTerm的配置方法 http://www.linuxidc.com/Linux/2013-06/86244.htmUbuntu 10.04下QT4.7.4移植详解 http://www.linuxidc.com/Linux/2013-01/77930.htm更多Ubuntu相关信息见Ubuntu 专题页面 http://www.linuxidc.com/topicnews.aspx?tid=2Ubuntu下搭建JavaEE开发环境举例说明Linux diff 命令相关资讯      Qt4 
  • QT4 中文提示出现乱码  (03/26/2014 08:37:25)
  • CentOS安装QT4遇到的问题  (08/15/2012 08:59:14)
  • Qwit 1.1 Pre 2 ,已支持 OAuth  (09/29/2010 06:02:14)
  • 迁移 Qt4 至 Qt5 的几个主要环节  (01/13/2013 14:15:37)
  • Real6410 QT4开发环境配置详解  (05/05/2012 09:32:58)
  • Ubuntu下Qt4开发环境的安装  (04/12/2010 06:54:33)
本文评论 查看全部评论 (0)
表情: 姓名: 字数