目录
一、环境
硬件:Jetson Xavier NX 套件
系统:Ubuntu 20.4
QT :QT5.12.9
QT Creator:4.11
二、问题
报错找不到“stddef.h”头文件,但是切换过去查看,头文件是存在并且能正常打开的。而且虽然报错,但是能够成功运行。
cstddef:50:10: fatal error: 'stddef.h' file not found
main.cpp:1:1: note: in file included from /home/main.cpp:1:
main.cpp:1:10: note: in file included from /home/main.cpp:1:
QGuiApplication:1:10: note: in file included from /opt/qt5.12.9_aarch64/include/QtGui/QGuiApplication:1:
qguiapplication.h:43:10: note: in file included from /opt/qt5.12.9_aarch64/include/QtGui/qguiapplication.h:43:
qtguiglobal.h:43:10: note: in file included from /opt/qt5.12.9_aarch64/include/QtGui/qtguiglobal.h:43:
qglobal.h:46:12: note: in file included from /opt/qt5.12.9_aarch64/include/QtCore/qglobal.h:46:
三、解决方法
方法一:取消使用 ClangCodeModel 插件,此插件会对代码进行分析,然后给出警告。关闭后会丧失智能提醒的功能。
方法二:安装合适版本的libclang-common组件
1、查看系统安装的组件版本
apt list --installed | grep "libclang-common*"
2、安装低版本组件 ,由于ClangCodeModel 4.11需要libclang-common-8-dev,所以安装libclang-common-8-dev
sudo apt-get install libclang-common-8-dev
3、重启QT Creator
OK!
至此,问题解决。