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

来源:互联网 发布:手机找淘宝货源 编辑:程序博客网 时间:2024/04/29 16:34

在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.cppg++ -m64 -Wl,-O1 -o qt4hello qthello.o    -L/usr/lib/x86_64-linux-gnu -lQtGui -lQtCore -lpthread 
--->./qt4hello(文件夹的名称)

原创粉丝点击