Search code examples
qtraspberry-piyocto

Qt6 yocto build - filesystem no such file


I'm building yocto image (core-image-minimal) on Ubuntu 18.04, default configuration and I added Qt6 to it.

Build Configuration:
BB_VERSION           = "2.2.0"
BUILD_SYS            = "x86_64-linux"
NATIVELSBSTRING      = "universal"
TARGET_SYS           = "arm-poky-linux-gnueabi"
MACHINE              = "raspberrypi3"
DISTRO               = "poky"
DISTRO_VERSION       = "4.1.4"
TUNE_FEATURES        = "arm vfp cortexa7 neon vfpv4 thumb callconvention-hard"
TARGET_FPU           = "hard"
meta                 
meta-poky            
meta-yocto-bsp       = "langdale:3e95f268ce04b49ba6731fd4bbc53b1693c21963"
meta-raspberrypi     = "langdale:8e3cbfa598de106a78d9a9e27aa25ded51416896"
meta-oe              
meta-multimedia      
meta-networking      
meta-python          = "langdale:cbbaa82238cd60f08c9b9cb58dde59d5f9318c7b"
meta-qt6             = "6.5:a65fb409f4469c087ae3e23ee80fbb2531f1856e"

and I get this error:

|   /home/martin/Downloads/yocto/build/tmp/work/x86_64-linux/qtbase-native/6.5.4-r0/git/src/tools/syncqt/main.cpp:24:10:
|   fatal error: filesystem: No such file or directory
| 
|    #include <filesystem>
|             ^~~~~~~~~~~~
| 
|   compilation terminated.

Any idea how to fix it?


Solution

  • The filesystem header was introduced in GCC v8 according to Why does GCC not seem to have the filesystem standard library?. Ubuntu 18 seems to include gcc v7.

    If you have a look at Qt dev pages https://doc.qt.io/qt-6.5/linux-building.html you'll see they support only newer compiler versions.

    I'm not sure if Yocto uses the system compiler to build x64 libraries, but if that is the case, it may be the reason of the error. We can check this if you provide the entire log. In this case you can simply install a newer compiler or use a newer Ubuntu.

    I recently built Qt 6.5 with Yocto and I do not remember that error. I used a container with Ubuntu 22.04.