Qt在Raspberry Pi 3上交叉编译-配置错误

时间:2018-11-08 16:16:36

标签: cross-compiling raspberry-pi3 raspbian

我正在尝试根据本教程https://medium.com/@amirmann/how-to-cross-compile-qt-for-raspberry-pi-3-on-linux-ubuntu-for-beginners-75acf2a078c交叉编译Raspberry Pi 3的Qt 5。 一切都很好,但是当我执行时: sudo ./configure -opengl es2 -device linux-rasp-pi-g++ -device-option CROSS_COMPILE=$RPI_TOOLCHAIN -sysroot $RPI_SYSROOT -opensource -confirm-license -optimized-qmake -reduce-exports -release -make libs -prefix /usr/local/qt5pi -skip qtwebkit

此消息出现在终端中:

Creating qmake...
.Done.

This is the Qt Open Source Edition.

You have already accepted the terms of the Open Source license.

Running configuration tests... Checking for valid makespec... Note: Also available for Linux: linux-clang linux-icc

ERROR: Cannot compile a minimal program. The toolchain or QMakeSpec is broken.

Check config.log for details.

在config.log文件中,有:

  

命令行:-opengl es2 -device linux-rasp-pi-g ++ -device-option> CROSS_COMPILE = / home / riahi / crosscompile-tools / tools / arm-bcm2708 / gcc-linaro-arm-> linux-gnueabihf -raspbian-x64 / bin / arm-linux-gnueabihf- -sysroot / mnt / rasp-pi-> rootfs -opensource -confirm-license -optimized-qmake -reduce-exports -release-> make libs-前缀/ usr / local / qt5pi-不使用金链接器   执行配置测试verifyspec   + cd /home/riahi/Qt5.10.0/5.10.0/Src/config.tests/verifyspec &&> /home/riahi/Qt5.10.0/5.10.0/Src/qtbase/bin/qmake“ CONFIG-= qt debug_and_release > app_bundle lib_bundle“”配置+ =共享warn_off控制台single_arch“>” QMAKE_CFLAGS + = --sysroot = / mnt / rasp-pi-rootfs“” QMAKE_CXXFLAGS + =->> sysroot = / mnt / rasp-pi-rootfs“” QMAKE_LFLAGS + = --sysroot = / mnt / rasp-pi-rootfs“->早期的” CONFIG + = cross_compile“> /home/riahi/Qt5.10.0/5.10.0/Src/qtbase/config.tests/verifyspec   + cd /home/riahi/Qt5.10.0/5.10.0/Src/config.tests/verifyspec && MAKEFLAGS => / usr / bin / make clean && MAKEFLAGS = / usr / bin / make

     

rm -f verifyspec.o   rm -f *〜核心* .core   / home / riahi / crosscompile-tools / tools / arm-bcm2708 / gcc-linaro-arm-linux-gnueabihf-raspbian-x64 / bin / arm-linux-gnueabihf-g ++ -c -pipe -marm -mfpu = vfp -mtune = arm1176jzf-s -march = armv6zk -mabi = aapcs-linux -mfloat-abi = hard --sysroot = / mnt / rasp-pi-rootfs -O2 -std = gnu ++ 11 -w -fPIC -I / home / riahi / Qt5.10.0 / 5.10.0 / Src / qtbase / config.tests / verifyspec -I。 -I / home / riahi / Qt5.10.0 / 5.10.0 / Src / qtbase / mkspecs / devices / linux-rasp-pi-g ++ -o verifyspec.o /home/riahi/Qt5.10.0/5.10.0/Src/ qtbase / config.tests / verifyspec / verifyspec.cpp   / home / riahi / crosscompile-tools / tools / arm-bcm2708 / gcc-linaro-arm-linux-gnueabihf-raspbian-x64 / bin / arm-linux-gnueabihf-g ++ -mfloat-abi = hard --sysroot = / mnt / rasp-pi-rootfs -Wl,-O1 -Wl,-rpath-link,/ mnt / rasp-pi-rootfs / opt / vc / lib -Wl,-rpath-link,/ mnt / rasp-pi-rootfs / usr / lib / arm-linux-gnueabihf -Wl,-rpath-link,/ mnt / rasp-pi-rootfs / lib / arm-linux-gnueabihf -o verifyspec verifyspec.o
  /home/riahi/crosscompile-tools/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/../lib/gcc/arm-linux-gnueabihf/4.8.3/。。 /../../../arm-linux-gnueabihf/bin/ld:找不到crt1.o:没有这样的文件或目录   /home/riahi/crosscompile-tools/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/../lib/gcc/arm-linux-gnueabihf/4.8.3/。。 /../../../arm-linux-gnueabihf/bin/ld:找不到crti.o:没有这样的文件或目录   /home/riahi/crosscompile-tools/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/../lib/gcc/arm-linux-gnueabihf/4.8.3/。。 /../../../arm-linux-gnueabihf/bin/ld:/home/riahi/crosscompile-tools/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin /../lib/gcc/arm-linux-gnueabihf/4.8.3/../../../../arm-linux-gnueabihf/lib/libstdc++.so:无法识别文件格式;作为链接描述文件   /home/riahi/crosscompile-tools/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/../lib/gcc/arm-linux-gnueabihf/4.8.3/。。 /../../../arm-linux-gnueabihf/bin/ld:/home/riahi/crosscompile-tools/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin /../lib/gcc/arm-linux-gnueabihf/4.8.3/../../../../arm-linux-gnueabihf/lib/libstdc++.so:1:语法错误   collect2:错误:ld返回1退出状态   Makefile:66:目标“ verifyspec”的配方失败   make:*** [verifyspec]错误1

我认为此文件中的主要问题是:

  1. 找不到crt1.o:没有这样的文件或目录
  2. 找不到crti.o:没有这样的文件或目录
  3. .... / libstdc ++。so:无法识别文件格式;视为链接脚本

我很困惑,并且我为这些问题苦苦挣扎了几天。 我是初学者。 有人可以帮我吗?

0 个答案:

没有答案