移植Qt到openwrt开发板中

我希望我写的文章可以帮助到你,因此我把全部过程都记录下来了,你可以不用到起到文章中查看了,而且格式也调试到查看尽量舒服一些。

环境:

PC机:Ubuntu16.04
开发板:mipsel mt7688

一、环境依赖软件

$ sudo apt-get install libxtst-dev libx11-dev libxext-dev

二、获取源码

Qt源程序获取:https://download.qt.io/archive/qt/4.8/4.8.3/
Ubuntu下选择tar.gz的程序包:qt-everywhere-opensource-src-4.8.3.tar.gz

三、编译环境

./configure编译生成makefile文件,如果没有生成makefile多半是没有设置好,需要添加配置条件,如下。
–prefix(指定编译完成的生成路径,无需创建文件夹,自动生成)

$./configure -xplatform qws/linux-mips-g++ \
			--prefix=$(pwd)/install-tslib \
			-little-endian
Which edition of Qt do you want to use ?

Type 'c' if you want to use the Commercial Edition.
Type 'o' if you want to use the Open Source Edition.

o

Do you accept the terms of either license? yes
Creating qmake. Please wait...
make: Nothing to be done for 'first'.
Warning: -no-xrender will disable the QtWebkit module.
rm -f endiantest.o
rm -f *~ core *.core
rm -f endiantest 
rm -f Makefile
rm -f endiantest.o
rm -f *~ core *.core
rm -f endiantest 
rm -f Makefile
ln: failed to create symbolic link '/home/wooya/qt-everywhere-opensource-src-4.8.3/include/QtCore/qconfig.h': File exists
ln: failed to create symbolic link '/home/wooya/qt-everywhere-opensource-src-4.8.3/include/Qt/qconfig.h': File exists

        This target is using the GNU C++ compiler (linux-g++).

        Recent versions of this compiler automatically include code for
        exceptions, which increase both the size of the Qt libraries and
        the amount of memory taken by your applications.

        You may choose to re-run configure with the -no-exceptions
        option to compile Qt without exceptions. This is completely binary
        compatible, and existing applications will continue to work.


Build type:    linux-g++
Architecture:  i386
Platform notes:

            - Also available for Linux: linux-kcc linux-icc linux-cxx
        
Build .................. libs tools examples demos docs translations
Configuration ..........  release shared dll largefile stl precompile_header mmx 3dnow sse sse2 sse3 ssse3 sse4_1 sse4_2 avx  minimal-config small-config medium-config large-config full-config qt3support accessibility reduce_exports ipv6 clock-gettime clock-monotonic mremap getaddrinfo ipv6ifname getifaddrs inotify png freetype system-zlib nis iconv openssl x11sm xshape xsync mitshm xkb concurrent multimedia audio-backend svg script scripttools declarative release
Debug .................. no
Qt 3 compatibility ..... yes
QtDBus module .......... no
QtConcurrent code ...... yes


....此处省略上万字


Qt is now configured for building. Just run 'make'.
Once everything is built, you must run 'make install'.
Qt will be installed into /home/wooya/qt-everywhere-opensource-src-4.8.3/install-qt

To reconfigure, run 'make confclean' and 'configure'.

make && make install编译生成在install-qt/bin下面能够看到我们要使用的qmake工具

期间编译时间很长,时间论cpu的速度而定

$ make && make install

cd src/tools/bootstrap/ && make -f Makefile 
make[1]: Entering directory '/home/wooya/qt-everywhere-opensource-src-4.8.3/src/tools/bootstrap'
g++ -c -pipe -O2 -fPIC -Wall -W -DQT_BOOTSTRAPPED -DQT_LITE_UNICODE -DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_TO_ASCII -DQT_NO_CODECS -DQT_NO_DATASTREAM -DQT_NO_GEOM_VARIANT -DQT_NO_LIBRARY -DQT_NO_QOBJECT -DQT_NO_STL -DQT_NO_SYSTEMLOCALE -DQT_NO_TEXTSTREAM -DQT_NO_THREAD -DQT_NO_UNICODETABLES -DQT_NO_USING_NAMESPACE -DQT_NO_DEPRECATED -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -I../../../mkspecs/linux-g++ -I. -I../../../include -I../../../include/QtCore -I../../../include/QtXml -o .obj/release-static/qisciicodec.o ../../corelib/codecs/qisciicodec.cpp
g++ -c -pipe -O2 -fPIC -Wall -W -DQT_BOOTSTRAPPED -DQT_LITE_UNICODE -DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_TO_ASCII -DQT_NO_CODECS -DQT_NO_DATASTREAM -DQT_NO_GEOM_VARIANT -DQT_NO_LIBRARY -DQT_NO_QOBJECT -DQT_NO_STL -DQT_NO_SYSTEMLOCALE -DQT_NO_TEXTSTREAM -DQT_NO_THREAD -DQT_NO_UNICODETABLES -DQT_NO_USING_NAMESPACE -DQT_NO_DEPRECATED -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -I../../../mkspecs/linux-g++ -I. -I../../../include -I../../../include/QtCore -I../../../include/QtXml -o .obj/release-static/qlatincodec.o ../../corelib/codecs/qlatincodec.cpp
g++ -c -pipe -O2 -fPIC -Wall -W -DQT_BOOTSTRAPPED -DQT_LITE_UNICODE -DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_TO_ASCII -DQT_NO_CODECS -DQT_NO_DATASTREAM -DQT_NO_GEOM_VARIANT -DQT_NO_LIBRARY -DQT_NO_QOBJECT -DQT_NO_STL -DQT_NO_SYSTEMLOCALE -DQT_NO_TEXTSTREAM -DQT_NO_THREAD -DQT_NO_UNICODETABLES -DQT_NO_USING_NAMESPACE -DQT_NO_DEPRECATED -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -I../../../mkspecs/linux-g++ -I. -I../../../include -I../../../include/QtCore -I../../../include/QtXml -o .obj/release-static/qsimplecodec.o ../../corelib/codecs/qsimplecodec.cpp
g++ -c -pipe -O2 -fPIC -Wall -W -DQT_BOOTSTRAPPED -DQT_LITE_UNICODE -DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_TO_ASCII -DQT_NO_CODECS -DQT_NO_DATASTREAM -DQT_NO_GEOM_VARIANT -DQT_NO_LIBRARY -DQT_NO_QOBJECT -DQT_NO_STL -DQT_NO_SYSTEMLOCALE -DQT_NO_TEXTSTREAM -DQT_NO_THREAD -DQT_NO_UNICODETABLES -DQT_NO_USING_NAMESPACE -DQT_NO_DEPRECATED -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -I../../../mkspecs/linux-g++ -I. -I../../../include -I../../../include/QtCore -I../../../include/QtXml -o .obj/release-static/qtextcodec.o ../../corelib/codecs/qtextcodec.cpp


...此处省略上万字符

四、环境

将install的内容/home/wooya/qt-everywhere-opensource-src-4.8.3/install-qt

…还未写完

参考:
https://blog.csdn.net/a137748099/article/details/106387617
https://blog.csdn.net/guoguoshizhuo/article/details/19181463

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值