参考博客:https://blog.csdn.net/yihui8/article/details/39503645
自己写的好多程序都是以QT库为基础的。QT提供的开发工具和库用起来很方便。
开发板提供的软件包没有提供QT库,就自己参考网上的文章自己编译了。。
记录下编译过程:
下载qt源码:
http://download.qt.io/archive/qt/4.8/4.8.7/
修改对应的文件:
qt-everywhere-opensource-src-4.8.7/mkspecs/qws/linux-mips-g++/qmake.conf
#
# qmake configuration for building with mipsel-linux-g++
#
include(../../common/linux.conf)
include(../../common/gcc-base-unix.conf)
include(../../common/g++-unix.conf)
include(../../common/qws.conf)
# modifications to g++.conf
QMAKE_CC = mipsel-openwrt-linux-gcc
QMAKE_CXX = mipsel-openwrt-linux-g++
QMAKE_CFLAGS += -mips32
QMAKE_CXXFLAGS += -mips32
QMAKE_LINK = mipsel-openwrt-linux-g++
QMAKE_LINK_SHLIB = mipsel-openwrt-linux-g++
# modifications to linux.conf
QMAKE_AR = mipsel--linux-ar cqs
QMAKE_OBJCOPY = mipsel-openwrt-linux-objcopy
QMAKE_STRIP = mipsel-openwrt-linux-strip
load(qt_config)
编译参数:
./configure -force-pkg-config \
-prefix /opt/mipsQT \
-release \
-opensource \
-shared \
-qconfig dist \
-no-exceptions \
-no-accessibility \
-no-stl \
-no-qt3support \
-no-xmlpatterns \
-no-multimedia \
-no-audio-backend \
-no-phonon \
-no-phonon-backend \
-no-svg \
-no-webkit \
-no-javascript-jit \
-no-script \
-no-scripttools \
-no-declarative \
-no-declarative-debug \
-qt-zlib \
-qt-freetype \
-no-gif \
-no-libpng \
-no-libmng \
-no-libtiff \
-no-libjpeg \
-no-openssl \
-nomake tools \
-nomake demos \
-nomake examples \
-nomake docs \
-nomake translations \
-no-nis \
-no-cups \
-no-iconv \
-no-pch \
-embedded mips \
-little-endian \
-platform qws/linux-x86-g++ \
-xplatform qws/linux-mips-g++ \
-no-gtkstyle \
-no-nas-sound \
-no-opengl \
-no-openvg \
-no-sm \
-no-xshape \
-no-xvideo \
-no-xsync \
-no-xinerama \
-no-xcursor \
-no-xfixes \
-no-xrandr \
-no-xrender \
-no-mitshm \
-no-fontconfig \
-no-xinput \
-no-xkb \
-no-dbus \
-no-gui
最后
make
make install
编译的时候回出现以下错误:
修改qmake生成的Makefile文件在LIBS后面添加-ldl 即可。