Important: Please read the Qt Code of Conduct -

Syntax highlighting fails when using cross-compiler

  • I moved from an older version of Qt Creator to 4.8.1 with the strange effect that the syntax highlighting fails when using the gcc-linaro-arm-linux-gnueabihf-raspbian-x64 cross compiler. Funny enough, the compilation itself works fine. If I use the default compiler for my machine, highlighting (and compilation) works fine too.
    So the symptoms are:

    • The highlighting worked fine for an older Qt Creator (the latest one at the time when Qt 5.6.2 came out...)

    • There are no issues for "Desktop builds", that is using the default compiler.

    • Compilation is not affected, only syntax highlighting.

    • The compiler in question is the usual linaro ARM cross compiler used for Raspberry Pi

    • The highlighting seems to fail because it can't find include files, but this is only a guess. In the GUI you get a mixture of "unknown type" and "file not found". Include filles affected are std:: includes and low-level, probably compiler specific includes.

    • I am working on Ubunutu 16.04LTS

    • The linaro toolchain was installed through

    I think the discovery of include files is done by starting the compiler with some option to output the include paths. This mechanism seems to be broken for the combination Qt Creator 4.8.1 + linaro-ARM.
    Does anyone have an idea what to do or how to investigate further? Any hints are warmly welcome.
    If you think I should move to the Qt on Pi forum let me know.

  • Well, I still don't understand exactly what happens but I solved the problem by using a different flavor of compiler from the same toolchain package. (arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf-g++). For this to work I had to set the ABI manually in the Tools->Options->Kits->Compiler->ABI fields. I always thought these fields are auto-detected from the compiler you select but obviously Qt creator accepts your manual selection.

Log in to reply