嵌入式linux开发,交叉编译qt4.8.5报错:Makefile:1054: recipe for target ‘.moc/release-shared-emb-arm/moc_qabstract
2023-09-14 09:09:33 时间
一、问题描述。
嵌入式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 。
相关文章
- ARM平台下Linux嵌入式环境搭建
- Linux应用与开发:发挥潜能(linux应用与开发)
- Linux中的局部变量展现它的价值(linux局部变量)
- 嵌入式Linux编程:掌握基础知识和技能。(嵌入式linux编程基础)
- 安装Linux下驱动程序:步骤指南(linux安装加载驱动)
- Linux 三剑客:方括号(linux方括号)
- Linux嵌入式:新技术开辟无限可能(linux嵌入式应用领域)
- 体验Linux检测功能,提升系统性能(linux系统检测)
- 学习Linux嵌入式:从零开始(linux嵌入式怎么学)
- Linux嵌入式面试指南:挑战技术极限(linux嵌入式面试题)
- 原理深入解析:嵌入式Linux工作机制(嵌入式linux工作)
- Linux桌面下终极命令必备攻略(linux桌面命令窗口)
- 实用Linux嵌入式系统技术的开启(linux的嵌入式系统)
- 聚焦Linux嵌入式讨论,探索新空间(linux嵌入式论坛)
- 嵌入式Linux初学者入门指南(嵌入式linux入门书籍)
- 基于Linux的嵌入式系统课程设计(linux嵌入式课程设计)
- Linux下实现LS命令的智慧方式(linux实现ls命令)
- Linux动态数组:实现运行时动态伸缩(linux动态数组)
- Linux防火墙关闭操作指南(关闭linux的防火墙)
- Linux系统带你领略嵌入式浏览器之美(linux嵌入式浏览器)
- Linux 全文搜索:实现快速精准的搜索(linux全文搜索)
- 快速构建Linux嵌入式开发简历(linux嵌入式简历模板)
- 嵌入式Linux串口编程之路(嵌入式linux串口编程)
- Linux端口共享 ─ 节约资源还能提高效率(linux端口共享)
- 嵌入式Linux:新就业机遇(嵌入式linux就业)
- Linux系统:轻松快捷的刻录之旅(linux系统刻录)
- 如何关闭Linux系统的防火墙(关闭linux系统防火墙)
- 地址Linux如何查看浮动IP地址(linux查看浮动ip)
- 嵌入式Linux系统中的MPU设计(mpu linux)
- 如何在Linux上配置静态IP(linux配置静态的ip)
- Linux双机实现可靠性配置(linux双机配置)