qt4.8.7交叉编译

来源:互联网 发布:windows server iscsi 编辑:程序博客网 时间:2024/06/05 15:34

From: http://zzj.1125.blog.163.com/blog/static/6216194420136755341477/

From: http://blog.csdn.net/sno_guo/article/details/7571264

./configure -prefix /usr/local/Qt-4.8.5-arm \    -release \    -shared \    -fast \    -opensource \    -no-3dnow \    -no-openssl \    -no-libmng \    -no-opengl \    -no-qvfb \    -no-glib \    -no-phonon  \    -nomake examples \    -nomake tools \    -nomake docs \    -nomake demos \    -qt-sql-sqlite \    -qt-libjpeg \    -qt-zlib \    -qt-libpng \    -xplatform qws/linux-arm-g++ \    -embedded arm \    -little-endian -depths 8 \    -confirm-license 
cat mkspecs/qws/linux-arm-g++/qmake.conf ## qmake configuration for building with arm-linux-g++#include(../../common/linux.conf)include(../../common/gcc-base-unix.conf)include(../../common/g++-unix.conf)include(../../common/qws.conf)# modifications to g++.confQMAKE_CC                = arm-linux-gnueabihf-gcc QMAKE_CXX               = arm-linux-gnueabihf-g++QMAKE_LINK              = arm-linux-gnueabihf-g++QMAKE_LINK_SHLIB        = arm-linux-gnueabihf-g++# modifications to linux.confQMAKE_AR                = arm-linux-gnueabihf-ar cqsQMAKE_OBJCOPY           = arm-linux-gnueabihf-objcopyQMAKE_STRIP             = arm-linux-gnueabihf-stripload(qt_config)

         hello.cpp源码:
         #include <QApplication>
         #include <QDebug>
         int main(int argc,char *argv[]) 
        {
            qDebug("Hello, welcome to Qt world!");
            return 0;
         }
  
  顺序执行以下操作:
  @1. 执行:qmake -project hello1.cpp
        生成 hello1.pro 工程文件
  @2. 执行:qmake hello1.pro
        生成 Makefile 文件 
  @3. 执行:make
        生成 hello.o, hello 文件 
  

原创粉丝点击