Important: Please read the Qt Code of Conduct -

How to set sysroot correctly

  • I set up a cross-compile environment for Qt5.9. In QtCreator > Options > Build & Run > Kits I selected my sysroot folder, that look like this:


    Here there are both cross-compiled Qt5 libraries and all other system ones. QtCreator find the Qt5 ones without any problem but can't find (some) others. For example I have the following library:


    and in my .pro file:

    LIBS += -ltag

    but it cannot find it, neither the include file (sysroot/usr/include/libtag/tag.h).
    Of course if I explicitly set the -L option to the right path it works, but I really don't want to do this because I will have to do for a lot of others.

    As far as I understand it should search into the sysroot path, shouldn't it?

  • Lifetime Qt Champion

    @Mark81 How do you include the header file?
    Did you try to put in sysroot/usr/lib ?

  • Well, eventually I found there were two sysroot folders, likely due to a typo in the scripts... hence it was searching in the wrong one.

Log in to reply