移植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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
要将Qt移植OpenWrt上,您可以按照以下步骤进行操作: 1. 下载Qt源代码。您可以从Qt官方网站下载适用于OpenWrtQt源代码。在下载页面选择合适的版本和文件类型,比如tar.gz的程序包(如qt-everywhere-opensource-src-4.8.3.tar.gz)。 2. 配置环境。在移植Qt之前,您需要配置适合OpenWrt的编译环境。首先,根据目标平台的要求,设置QMAKESPEC。这个环境变量指向qmake.conf的目标文件位置,并且需要修改编译工具的名称。其次,配置STAGING_DIR。这是OpenWrt平台所需的,它指向OpenWrt SDK目标平台的位置。 3. 生成Makefile。在移植Qt的源代码目录下,运行qmake命令,指定您的.pro文件和目标平台。这将生成一个Makefile,其包含将用于编译QtOpenWrt上的相关设置。 4. 修改Makefile。在生成的Makefile,您需要做一些修改。首先,将编译工具的具体位置添加到相应位置。其次,确保引用的类库和头文件在编译过程正确添加。 5. 编译和安装。使用make命令编译Qt源代码。一旦编译完成,您可以使用make install命令将编译后的内容安装到您指定的目录。 请注意,以上步骤只是一个大致的指导,具体的移植过程可能因为OpenWrt的版本和配置而有所不同。在实际操作,您可能需要根据您的环境和需求进行一些额外的调整和配置。 引用提供了Qt源程序获取的链接,引用和提供了一些关于配置和安装的参考信息。这些资料可以帮助您更详细地了解Qt移植OpenWrt的过程。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* *3* [移植Qtopenwrt开发板](https://blog.csdn.net/Pintitus/article/details/122573400)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] - *2* [编译OpenWrt平台上Qt程序的环境配置](https://blog.csdn.net/qianguozheng/article/details/45506037)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] [ .reference_list ]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值