一、问题描述。

嵌入式linux开发,交叉编译qt4.8.5,执行make时报错如下:

ms@ubuntu:~/work/code/qt/opensource/qt-everywhere-opensource-src-4.8.5$ make -j4
cd src/tools/bootstrap/ && make -f Makefile
make[1]: Entering directory '/home/ms/work/code/qt/opensource/qt-everywhere-opensource-src-4.8.5/src/tools/bootstrap'
make[1]: Nothing to be done for 'first'.
make[1]: Leaving directory '/home/ms/work/code/qt/opensource/qt-everywhere-opensource-src-4.8.5/src/tools/bootstrap'
cd src/tools/moc/ && make -f Makefile
make[1]: Entering directory '/home/ms/work/code/qt/opensource/qt-everywhere-opensource-src-4.8.5/src/tools/moc'
make[1]: Nothing to be done for 'first'.
make[1]: Leaving directory '/home/ms/work/code/qt/opensource/qt-everywhere-opensource-src-4.8.5/src/tools/moc'
cd src/tools/rcc/ && make -f Makefile
make[1]: Entering directory '/home/ms/work/code/qt/opensource/qt-everywhere-opensource-src-4.8.5/src/tools/rcc'
make[1]: Nothing to be done for 'first'.
make[1]: Leaving directory '/home/ms/work/code/qt/opensource/qt-everywhere-opensource-src-4.8.5/src/tools/rcc'
cd src/tools/uic/ && make -f Makefile
make[1]: Entering directory '/home/ms/work/code/qt/opensource/qt-everywhere-opensource-src-4.8.5/src/tools/uic'
make[1]: Nothing to be done for 'first'.
make[1]: Leaving directory '/home/ms/work/code/qt/opensource/qt-everywhere-opensource-src-4.8.5/src/tools/uic'
cd src/corelib/ && make -f Makefile
make[1]: Entering directory '/home/ms/work/code/qt/opensource/qt-everywhere-opensource-src-4.8.5/src/corelib'
/home/ms/work/code/qt/opensource/qt-everywhere-opensource-src-4.8.5/bin/moc -DQT_SHARED -DQT_BUILD_CORE_LIB -DQT_NO_USING_NAMESPACE -DQT_NO_CAST_TO_ASCII -DQT_ASCII_CAST_WARNINGS -DQT_MOC_COMPAT -DQT_USE_QSTRINGBUILDER -DELF_INTERPRETER=\"/lib64/ld-linux-x86-64.so.2\" -DHB_EXPORT=Q_CORE_EXPORT -DQT_NO_DEBUG -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -I../../mkspecs/qws/linux-arm-gnueabi-g++ -I. -I../../include -I../../include/QtCore -I.rcc/release-shared-emb-arm -Iglobal -I../3rdparty/zlib -I../3rdparty/harfbuzz/src -I../3rdparty/md5 -I../3rdparty/md4 -I.moc/release-shared-emb-arm animation/qabstractanimation.h -o .moc/release-shared-emb-arm/moc_qabstractanimation.cpp
/home/ms/work/code/qt/opensource/qt-everywhere-opensource-src-4.8.5/bin/moc -DQT_SHARED -DQT_BUILD_CORE_LIB -DQT_NO_USING_NAMESPACE -DQT_NO_CAST_TO_ASCII -DQT_ASCII_CAST_WARNINGS -DQT_MOC_COMPAT -DQT_USE_QSTRINGBUILDER -DELF_INTERPRETER=\"/lib64/ld-linux-x86-64.so.2\" -DHB_EXPORT=Q_CORE_EXPORT -DQT_NO_DEBUG -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -I../../mkspecs/qws/linux-arm-gnueabi-g++ -I. -I../../include -I../../include/QtCore -I.rcc/release-shared-emb-arm -Iglobal -I../3rdparty/zlib -I../3rdparty/harfbuzz/src -I../3rdparty/md5 -I../3rdparty/md4 -I.moc/release-shared-emb-arm animation/qvariantanimation.h -o .moc/release-shared-emb-arm/moc_qvariantanimation.cpp
/home/ms/work/code/qt/opensource/qt-everywhere-opensource-src-4.8.5/bin/moc -DQT_SHARED -DQT_BUILD_CORE_LIB -DQT_NO_USING_NAMESPACE -DQT_NO_CAST_TO_ASCII -DQT_ASCII_CAST_WARNINGS -DQT_MOC_COMPAT -DQT_USE_QSTRINGBUILDER -DELF_INTERPRETER=\"/lib64/ld-linux-x86-64.so.2\" -DHB_EXPORT=Q_CORE_EXPORT -DQT_NO_DEBUG -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -I../../mkspecs/qws/linux-arm-gnueabi-g++ -I. -I../../include -I../../include/QtCore -I.rcc/release-shared-emb-arm -Iglobal -I../3rdparty/zlib -I../3rdparty/harfbuzz/src -I../3rdparty/md5 -I../3rdparty/md4 -I.moc/release-shared-emb-arm animation/qpropertyanimation.h -o .moc/release-shared-emb-arm/moc_qpropertyanimation.cpp
/home/ms/work/code/qt/opensource/qt-everywhere-opensource-src-4.8.5/bin/moc: 1: /home/ms/work/code/qt/opensource/qt-everywhere-opensource-src-4.8.5/bin/moc: Syntax error: word unexpected (expecting ")")
/home/ms/work/code/qt/opensource/qt-everywhere-opensource-src-4.8.5/bin/moc -DQT_SHARED -DQT_BUILD_CORE_LIB -DQT_NO_USING_NAMESPACE -DQT_NO_CAST_TO_ASCII -DQT_ASCII_CAST_WARNINGS -DQT_MOC_COMPAT -DQT_USE_QSTRINGBUILDER -DELF_INTERPRETER=\"/lib64/ld-linux-x86-64.so.2\" -DHB_EXPORT=Q_CORE_EXPORT -DQT_NO_DEBUG -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -I../../mkspecs/qws/linux-arm-gnueabi-g++ -I. -I../../include -I../../include/QtCore -I.rcc/release-shared-emb-arm -Iglobal -I../3rdparty/zlib -I../3rdparty/harfbuzz/src -I../3rdparty/md5 -I../3rdparty/md4 -I.moc/release-shared-emb-arm animation/qanimationgroup.h -o .moc/release-shared-emb-arm/moc_qanimationgroup.cpp
Makefile:1054: recipe for target '.moc/release-shared-emb-arm/moc_qabstractanimation.cpp' failed
make[1]: *** [.moc/release-shared-emb-arm/moc_qabstractanimation.cpp] Error 2
make[1]: *** Waiting for unfinished jobs....
/home/ms/work/code/qt/opensource/qt-everywhere-opensource-src-4.8.5/bin/moc: 1: /home/ms/work/code/qt/opensource/qt-everywhere-opensource-src-4.8.5/bin/moc: Syntax error: word unexpected (expecting ")")
Makefile:1427: recipe for target '.moc/release-shared-emb-arm/moc_qpropertyanimation.cpp' failed
make[1]: *** [.moc/release-shared-emb-arm/moc_qpropertyanimation.cpp] Error 2
/home/ms/work/code/qt/opensource/qt-everywhere-opensource-src-4.8.5/bin/moc: 1: /home/ms/work/code/qt/opensource/qt-everywhere-opensource-src-4.8.5/bin/moc: Syntax error: word unexpected (expecting ")")
/home/ms/work/code/qt/opensource/qt-everywhere-opensource-src-4.8.5/bin/moc: 1: /home/ms/work/code/qt/opensource/qt-everywhere-opensource-src-4.8.5/bin/moc: Syntax error: word unexpected (expecting ")")
Makefile:1522: recipe for target '.moc/release-shared-emb-arm/moc_qanimationgroup.cpp' failed
make[1]: *** [.moc/release-shared-emb-arm/moc_qanimationgroup.cpp] Error 2
Makefile:1310: recipe for target '.moc/release-shared-emb-arm/moc_qvariantanimation.cpp' failed
make[1]: *** [.moc/release-shared-emb-arm/moc_qvariantanimation.cpp] Error 2
make[1]: Leaving directory '/home/ms/work/code/qt/opensource/qt-everywhere-opensource-src-4.8.5/src/corelib'
Makefile:204: recipe for target 'sub-corelib-make_default-ordered' failed
make: *** [sub-corelib-make_default-ordered] Error 2
ms@ubuntu:~/work/code/qt/opensource/qt-everywhere-opensource-src-4.8.5$

二、问题分析。

查看bin文件夹下的内容,新生成的文件有 moc、qmake、rcc、uic 四个文件。

ms@ubuntu:~/work/code/qt/opensource/qt-everywhere-opensource-src-4.8.5$ ll ./bin/
total 30264
drwxr-xr-x  2 ms ms     4096 Jul  3 18:59 ./
drwxr-xr-x 21 ms ms     4096 Jul  3 18:49 ../
-rwxr-xr-x  1 ms ms       73 Jun  7  2013 createpackage*
-rwxr-xr-x  1 ms ms     2034 Jun  7  2013 createpackage.bat*
-rwxr-xr-x  1 ms ms    16603 Jun  7  2013 createpackage.pl*
-rwxr-xr-x  1 ms ms       77 Jun  7  2013 elf2e32_qtwrapper*
-rw-r--r--  1 ms ms       72 Jun  7  2013 elf2e32_qtwrapper.bat
-rwxr-xr-x  1 ms ms    11024 Jun  7  2013 elf2e32_qtwrapper.pl*
-rwxr-xr-x  1 ms ms     4160 Jun  7  2013 findtr*
-rwxrwxr-x  1 ms ms  1252034 Jul  3 18:58 moc*
-rwxr-xr-x  1 ms ms       78 Jun  7  2013 patch_capabilities*
-rw-r--r--  1 ms ms       43 Jun  7  2013 patch_capabilities.bat
-rwxr-xr-x  1 ms ms    16982 Jun  7  2013 patch_capabilities.pl*
-rwxrwxr-x  1 ms ms 26542576 Jul  3 18:00 qmake*
-rwxrwxr-x  1 ms ms  1334643 Jul  3 18:58 rcc*
-rwxr-xr-x  1 ms ms     8489 Jun  7  2013 setcepaths.bat*
-rwxr-xr-x  1 ms ms    49356 Jun  7  2013 syncqt*
-rwxr-xr-x  1 ms ms     2046 Jun  7  2013 syncqt.bat*
-rwxrwxr-x  1 ms ms  1689755 Jul  3 18:59 uic*
ms@ubuntu:~/work/code/qt/opensource/qt-everywhere-opensource-src-4.8.5$

分别查看四个文件属性,发现编译的部分文件为arm下的执行文件,生成的四个新文件应都为x86下的可执行文件。

ms@ubuntu:~/work/code/qt/opensource/qt-everywhere-opensource-src-4.8.5$ file ./bin/moc
./bin/moc: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux.so.3, for GNU/Linux 2.6.16, not stripped
ms@ubuntu:~/work/code/qt/opensource/qt-everywhere-opensource-src-4.8.5$ file ./bin/qmake
./bin/qmake: ELF 64-bit LSB shared object, x86-64, version 1 (GNU/Linux), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, BuildID[sha1]=af6cf3584e066fd5127f354d26287e79280ab481, with debug_info, not stripped
ms@ubuntu:~/work/code/qt/opensource/qt-everywhere-opensource-src-4.8.5$ file ./bin/rcc
./bin/rcc: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux.so.3, for GNU/Linux 2.6.16, not stripped
ms@ubuntu:~/work/code/qt/opensource/qt-everywhere-opensource-src-4.8.5$ file ./bin/uic
./bin/uic: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux.so.3, for GNU/Linux 2.6.16, not stripped
ms@ubuntu:~/work/code/qt/opensource/qt-everywhere-opensource-src-4.8.5$

三、解决方案。

1、研究调整配置,未解决,配置如下:

./configure \-prefix /home/ms/work/product/ok335xD/tool/toolchain/qt4.8.5 \-release \-opensource \-shared \-fast \-qt-sql-sqlite \-no-qt3support \-no-phonon \-webkit \-platform qws/linux-x86_64-g++ \-no-mmx \-no-3dnow \-no-sse \-no-sse2 \-I/usr/local/arm/tslib/include \-L/usr/local/arm/tslib/lib \-qt-zlib \-no-libtiff\-qt-libtiff \-qt-libpng \-no-libmng \-qt-libmng \-no-libjpeg \-qt-libjpeg \-no-openssl \-nomake docs \-optimized-qmake \-no-nis \-no-cups \-pch \-no-separate-debug-info \-embedded arm \-xplatform qws/linux-arm-g++ \-little-endian \-host-little-endian \-qt-freetype \-depths 16,18,24,32 \-qt-gfx-linuxfb \-qt-gfx-transformed \-qt-kbd-linuxinput \-qt-mouse-linuxinput \-qt-mouse-tslib \-no-glib \\-confirm-license \-no-opengl \-no-qvfb
# -verbose

2、一天后,执行清除,去掉arm平台相关的两个参数,未解决,吐血。

make clean
make confclean
 -embedded arm \-xplatform qws/linux-arm-g++ \

3、一天后,更换交叉编译器,执行清除后编译,问题依旧。查看moc文件夹下相关文件,Makefile文件日期不变。最终确定,执行清除未能删除Makefile文件,删除源码,重新解压和配置,问题解决。

4、经确认,没有生成新 Makefile 文件的原因是使用了 -fast 参数,应用使用 -no-fast 。

嵌入式linux开发,交叉编译qt4.8.5报错:Makefile:1054: recipe for target ‘.moc/release-shared-emb-arm/moc_qabstract相关推荐

  1. 编译fastdfs报错Makefile:59: recipe for target 'fdfs_monitor' failed

    环境:ubuntu16.04 报错信息 : # ./make.sh #/configure../storage/trunk_mgr/trunk_shared.o:在函数'trunk_file_do_l ...

  2. XV6操作系统make报错Makefile:192: *** recipe commences before first target. Stop. 的解决方法

    XV6操作系统make报错Makefile:192: *** recipe commences before first target. Stop. 的解决方法   大家好,我叫亓官劼(qí guān ...

  3. 嵌入式linux开发,交叉编译qt4.8.5报错:not found (try using -rpath or -rpath-link)/home/ms/work/code/qt/opensourc

    一.问题描述. 嵌入式linux开发,交叉编译qt4.8.5,执行make时报错如下: make[3]: Entering directory '/home/ms/work/code/qt/opens ...

  4. 嵌入式Linux开发,Ubuntu22下交叉编译内核报错: multiple definition of `yylloc‘; scripts/dtc/dtc-lexer.lex.o:(.bss+0x0

    一.问题描述 嵌入式Linux开发,Ubuntu22下交叉编译内核报错: /usr/bin/ld: scripts/dtc/dtc-parser.tab.o:(.bss+0x10): multiple ...

  5. 嵌入式linux开发,对pcf8563时钟操作报错:rtc-pcf8563 0-0051: low voltage detected, date/time is not reliable.

    一.问题描述. 嵌入式linux开发,对pcf8563时钟操作报错如下: [root@ms ~]# hwclock -s rtc-pcf8563 0-0051: low voltage detecte ...

  6. 嵌入式Linux开发环境搭建-(4)安装交叉编译工具链

    在ubuntu16.04.2中,安装交叉编译工具链 在ubuntu中进行嵌入式应用程序开发,安装交叉编译工具链是不可缺少的一个环节. PC操作系统:ubuntu16.04.2 LTS 开发板:天嵌科技 ...

  7. linux 嵌入式 交叉 环境搭建 实验原理,实验三 嵌入式Linux开发环境的搭建

    南京邮电大学通达学院 实 验 报 告 实验 实验三题目 嵌入式Linux开发环境的搭建 课程名称 嵌入式驱动开发实验 学院 专业 班 实验者学号同做者学号 08002210 姓名 毛骏超 同做者学号 ...

  8. ubuntu20.04.1 64位搭建嵌入式linux开发环境

    目录 背景 开发环境的搭建 1.交叉编译工具的安装 2.开发工具和依赖库的安装 2.1. 必需部分 2.2.可选部分 ubuntu20.04.1 64位配置和编译Linux3.0内核 背景 市面上的嵌 ...

  9. 《嵌入式Linux开发实用教程》

    <嵌入式Linux开发实用教程> 基本信息 作者: 朱兆祺    李强    袁晋蓉 出版社:人民邮电出版社 ISBN:9787115334831 上架时间:2014-2-13 出版日期: ...

最新文章

  1. cnblogs-5个必须掌握的maven命令
  2. 网易云信入选《2021 年浙江省首版次软件产品应用推广指导目录》
  3. JavaScript 音频处理库 pico.js
  4. JAVA-初步认识-第八章-继承-单继承和多重继承
  5. 根据字符串自动构造对应类
  6. 工作项跟踪管理系统需求
  7. vue学习笔记-01-前端的发展历史(从后端到前端,再到前后端分离,再到全栈)
  8. 计算机网络 socket,[计算机网络]简单聊聊套接字 Socket
  9. 中学计算机课程课时,初中信息技术基础教案设计(课时).doc
  10. 深入学习 Intellij IDEA 调试技巧
  11. sql插入多条记录_如何在SQL中插入多条记录
  12. 10. python-es-8.3.3-IP范围聚合ip_range
  13. 【R语言】rep用法(自用)
  14. 软件测试中的Fault、Error和Failure
  15. win7无法自动获取dns服务器地址,Win7无法自动获取DNS与IP地址怎么办
  16. CF 950C.Zebras 模拟,set
  17. 机器视觉系统——照明
  18. Android Killer中apktool插件更新
  19. 影评系统的机遇和挑战
  20. 23个开源App的App Store地址和源代码

热门文章

  1. 比pnpm的更快的模块管理方案,提效竟有6倍?
  2. Hbase2.0版本 Region处于RIT状态
  3. FPGA时序约束与分析 (3)--- 虚拟时钟约束
  4. 高频可调开关电源工作原理 直流可调电源主部件
  5. ue4 物品随机生成
  6. Django项目中常使用的前端框架
  7. OpenVSwtich(OVS)Vlan间路由实战 附实验环境
  8. 10 款最好的 Python IDE
  9. oneinstack_Linux利用OneinStack搭建环境
  10. AI迷路了怎么办?Facebook正在训练AI学会问路