OpenEdv-开源电子网

 找回密码
 立即注册
正点原子全套STM32/Linux/FPGA开发资料,上千讲STM32视频教程免费下载...
查看: 184|回复: 0

fatal error: gnu/stubs-soft.h: No such file or directory

[复制链接]

31

主题

76

帖子

0

精华

中级会员

Rank: 3Rank: 3

积分
271
金钱
271
注册时间
2020-10-19
在线时间
57 小时
发表于 2024-12-4 17:49:50 | 显示全部楼层 |阅读模式
10金钱
我当前进行的开发主要是在ubuntu22.04上利用Cmake和Ninja以及交叉编译工具链进行Qt6.7.3源码的armhf架构构建。我碰到的主要问题其实跟版本无关,而是我在用Qt Creator进行构建时报错:
  1. /home/lucasyuen/qt/qt6Host/libexec/uic ../../mainwindow.ui -o ui_mainwindow.h
  2. arm-linux-gnueabihf-g++ -c -O2 -march=armv7-a -mfpu=vfp -mfloat-abi=hard -mfloat-abi=softfp --sysroot=/home/lucasyuen/sysroot -g -std=gnu++1z -Wall -Wextra -D_REENTRANT -DQT_QML_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I../../../untitled -I. -I../../../../sysroot/opt/prefix/include -I../../../../sysroot/opt/prefix/include/QtWidgets -I../../../../sysroot/opt/prefix/include/QtGui -I../../../../sysroot/opt/prefix/include/QtCore -I. -I. -I../../../../sysroot/usr/include -I../../../../sysroot/usr/include/arm-linux-gnueabihf -I../../../../sysroot/opt/prefix/mkspecs/devices/linux-zynq-g++ -o main.o ../../main.cpp
  3. arm-linux-gnueabihf-g++ -c -O2 -march=armv7-a -mfpu=vfp -mfloat-abi=hard -mfloat-abi=softfp --sysroot=/home/lucasyuen/sysroot -g -std=gnu++1z -Wall -Wextra -D_REENTRANT -DQT_QML_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I../../../untitled -I. -I../../../../sysroot/opt/prefix/include -I../../../../sysroot/opt/prefix/include/QtWidgets -I../../../../sysroot/opt/prefix/include/QtGui -I../../../../sysroot/opt/prefix/include/QtCore -I. -I. -I../../../../sysroot/usr/include -I../../../../sysroot/usr/include/arm-linux-gnueabihf -I../../../../sysroot/opt/prefix/mkspecs/devices/linux-zynq-g++ -o mainwindow.o ../../mainwindow.cpp
  4. arm-linux-gnueabihf-g++ -O2 -march=armv7-a -mfpu=vfp -mfloat-abi=hard -mfloat-abi=softfp --sysroot=/home/lucasyuen/sysroot -g -std=gnu++1z -Wall -Wextra -dM -E -o moc_predefs.h ../../../../sysroot/opt/prefix/mkspecs/features/data/dummy.cpp
  5. /home/lucasyuen/qt/qt6Host/libexec/moc -DQT_QML_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB --include /home/lucasyuen/qtprj/untitled/build/zynq_qt-Debug/moc_predefs.h -I/home/lucasyuen/sysroot/opt/prefix/mkspecs/devices/linux-zynq-g++ -I/home/lucasyuen/qtprj/untitled -I/home/lucasyuen/sysroot/opt/prefix/include -I/home/lucasyuen/sysroot/opt/prefix/include/QtWidgets -I/home/lucasyuen/sysroot/opt/prefix/include/QtGui -I/home/lucasyuen/sysroot/opt/prefix/include/QtCore -I. -I/usr/arm-linux-gnueabihf/include/c++/11 -I/usr/arm-linux-gnueabihf/include/c++/11/arm-linux-gnueabihf -I/usr/arm-linux-gnueabihf/include/c++/11/backward -I/usr/lib/gcc-cross/arm-linux-gnueabihf/11/include -I/usr/arm-linux-gnueabihf/include -I/home/lucasyuen/sysroot/usr/include/arm-linux-gnueabihf -I/home/lucasyuen/sysroot/usr/include ../../mainwindow.h -o moc_mainwindow.cpp
  6. In file included from /usr/arm-linux-gnueabihf/include/features.h:510,
  7.                  from /usr/arm-linux-gnueabihf/include/c++/11/arm-linux-gnueabihf/bits/os_defines.h:39,
  8.                  from /usr/arm-linux-gnueabihf/include/c++/11/arm-linux-gnueabihf/bits/c++config.h:586,
  9.                  from /usr/arm-linux-gnueabihf/include/c++/11/type_traits:38,
  10.                  from ../../../../sysroot/opt/prefix/include/QtCore/qglobal.h:13,
  11.                  from ../../../../sysroot/opt/prefix/include/QtGui/qtguiglobal.h:7,
  12.                  from ../../../../sysroot/opt/prefix/include/QtWidgets/qtwidgetsglobal.h:7,
  13.                  from ../../../../sysroot/opt/prefix/include/QtWidgets/qmainwindow.h:7,
  14.                  from ../../../../sysroot/opt/prefix/include/QtWidgets/QMainWindow:1,
  15.                  from ../../mainwindow.h:4,
  16.                  from ../../main.cpp:1:
  17. /usr/arm-linux-gnueabihf/include/gnu/stubs.h:7:11: fatal error: gnu/stubs-soft.h: No such file or directory
  18.     7 | # include <gnu/stubs-soft.h>
  19.       |           ^~~~~~~~~~~~~~~~~~
  20. In file included from /usr/arm-linux-gnueabihf/include/features.h:510,
  21.                  from /usr/arm-linux-gnueabihf/include/c++/11/arm-linux-gnueabihf/bits/os_defines.h:39,
  22.                  from /usr/arm-linux-gnueabihf/include/c++/11/arm-linux-gnueabihf/bits/c++config.h:586,
  23.                  from /usr/arm-linux-gnueabihf/include/c++/11/type_traits:38,
  24.                  from ../../../../sysroot/opt/prefix/include/QtCore/qglobal.h:13,
  25.                  from ../../../../sysroot/opt/prefix/include/QtGui/qtguiglobal.h:7,
  26.                  from ../../../../sysroot/opt/prefix/include/QtWidgets/qtwidgetsglobal.h:7,
  27.                  from ../../../../sysroot/opt/prefix/include/QtWidgets/qmainwindow.h:7,
  28.                  from ../../../../sysroot/opt/prefix/include/QtWidgets/QMainWindow:1,
  29.                  from ../../mainwindow.h:4,
  30.                  from ../../mainwindow.cpp:1:
  31. /usr/arm-linux-gnueabihf/include/gnu/stubs.h:7:11: fatal error: gnu/stubs-soft.h: No such file or directory
  32.     7 | # include <gnu/stubs-soft.h>
  33.       |           ^~~~~~~~~~~~~~~~~~
  34. compilation terminated.
  35. compilation terminated.
  36. make: *** [Makefile:1645: main.o] Error 1
  37. make: *** Waiting for unfinished jobs....
  38. make: *** [Makefile:1913: mainwindow.o] Error 1
  39. 17:32:45: 进程"/usr/bin/make"退出,退出代码 2 。
  40. Error while building/deploying project untitled (kit: zynq_qt)
  41. The kit zynq_qt has configuration issues which might be the root cause for this problem.
  42. When executing step "Make"
复制代码
我不清楚为什么它会自动添加了-mfloat-abi=softfp 这个选项,因为我的cmake工具链配置和qmake.conf添加的都是-mfloat-abi=hard
toolchain.camke
  1. # 为 C 编译器设置标志
  2. set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --sysroot=${CMAKE_SYSROOT} -fPIC -Wl,-rpath-link,${CMAKE_SYSROOT}/lib/${CMAKE_LIBRARY_ARCHITECTURE} -Wl,-rpath-link,${CMAKE_SYSROOT}/usr/lib/${CMAKE_LIBRARY_ARCHITECTURE} -L${CMAKE_SYSROOT}/lib -L${CMAKE_SYSROOT}/lib/${CMAKE_LIBRARY_ARCHITECTURE} -L${CMAKE_SYSROOT}/usr/lib/${CMAKE_LIBRARY_ARCHITECTURE} -I${CMAKE_SYSROOT}/usr/include -I${CMAKE_SYSROOT}/usr/include/${CMAKE_LIBRARY_ARCHITECTURE} -march=armv7-a -marm -mfpu=vfp -mfloat-abi=hard")

  3. # 为 C++ 编译器设置标志
  4. set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --sysroot=${CMAKE_SYSROOT} -fPIC -Wl,-rpath-link,${CMAKE_SYSROOT}/lib/${CMAKE_LIBRARY_ARCHITECTURE} -Wl,-rpath-link,${CMAKE_SYSROOT}/usr/lib/${CMAKE_LIBRARY_ARCHITECTURE} -L${CMAKE_SYSROOT}/lib -L${CMAKE_SYSROOT}/lib/${CMAKE_LIBRARY_ARCHITECTURE} -L${CMAKE_SYSROOT}/usr/lib/${CMAKE_LIBRARY_ARCHITECTURE} -I${CMAKE_SYSROOT}/usr/include -I${CMAKE_SYSROOT}/usr/include/${CMAKE_LIBRARY_ARCHITECTURE} -march=armv7-a -marm -mfpu=vfp -mfloat-abi=hard")
复制代码
qmake.conf
  1. # 设置编译选项
  2. QT_QPA_DEFAULT_PLATFORM = xcb
  3. QMAKE_CFLAGS = -O2 -march=armv7-a -mfpu=vfp -mfloat-abi=hard
  4. QMAKE_CXXFLAGS = $QMAKE_CFLAGS
复制代码
希望有经验的大佬能帮忙解决下。

正点原子逻辑分析仪DL16劲爆上市
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则



关闭

原子哥极力推荐上一条 /2 下一条

正点原子公众号

QQ|手机版|OpenEdv-开源电子网 ( 粤ICP备12000418号-1 )

GMT+8, 2025-1-19 03:27

Powered by OpenEdv-开源电子网

© 2001-2030 OpenEdv-开源电子网

快速回复 返回顶部 返回列表