qt源码编译

  • 从 Index of /archive/qt/5.15/5.15.0/single 下载 qt-everywhere-src-5.15.0.tar.xz 到Linux系统下并解压

  • 进入解压目录,然后新建编译脚本 make.sh
# cd qt-everywhere-src-5.15.0
# touch make.sh
# chmod 777 make.sh
#!/bin/sh
PWD=`pwd`
    mkdir install
    ./configure \
    -prefix $PWD/install \
    -static \
    -release \
    -opensource \
    -xplatform linux-arm-gnueabi-g++ \
    -optimized-qmake -pch \
    -qt-libjpeg \
    -qt-libpng \
    -qt-zlib \
    -no-opengl \
    -skip qt3d \
    -skip qtcanvas3d \
    -skip qtpurchasing \
    -skip qtlocation \
    -skip qttools \
    -no-sse2 \
    -no-openssl \
    -no-cups \
    -no-glib \
    -no-iconv \
    -tslib \
    -linuxfb \
    -I /home/lck/ssd20x/qt/tslib-1.15/install/include \
    -L /home/lck/ssd20x/qt/tslib-1.15/install/lib \
    -recheck-all \
    -make examples

    make -j16 
    make install
  • 修改qmake.conf
vi qtbase/mkspecs/linux-arm-gnueabi-g++/qmake.conf

qt源码编译_第1张图片​​​​​​​

  • 开始交叉编译
# ./make.sh
  • 设置qmake环境变量
# vi ~/.bashrc

增加如下字段(根据自己的环境设置路径)
export PATH=/home/dell/ssd20x/qt/qt-everywhere-src-5.15.0/install/bin:$PATH

# source ~/.bashrc
# which qmake

你可能感兴趣的:(qt,开发语言)