Important: Please read the Qt Code of Conduct -

Correct way to use external lib in cross compiling like curses

  • Hi All,

    I have a project which is running in i386 linux and arm linux (wandboard debian hf) too.
    In i386 I can use curses very easy.

    in .pro: unix:!macx: LIBS += -lncurses

    There is a debian distrib on the arm device, where installed curses too from package.


    I would like to crosscompiling in i386 debian linux device with linaro arm cross compiler.
    When I want to crosscompiling to arm debian it said: curses.h not found.
    Its correct because cc uses its own include and lib dirs.

    I tried:

    • copy curses.h to linaro_root/arm-linux-gnueabihf/libc/usr/include

    • copy libncurses* libs to linaro_root/arm-linux-gnueabihf/libc/usr/lib/arm-linux-gnueabihf dir

    After that compiler can compile, but cannot links: cannot find

    maybe it is not the correct way to set external lib?

    How can I set an external lib to use in arm crosscompiling?

    thx a lot

  • I found a in /usr/lib directory of arm device.
    After I copied it into the lib of linaro directory, compiler missed tinfo lib.
    I found an libtinfo.a and I copied it into linaro.
    Finally I can compile the arm target and it works well, but I don't think it is a correct way.

  • Lifetime Qt Champion


    Technically, you need to provide your cross-compiling environment with the missing libraries/headers in order to build. One way is to cross-compile all dependencies and install them in your cross-compiling environment or get pre-built packages like those from debian's armel port. Also depending on what you use to generate the root fs (e.g. the yocto project) you would just need to add these packages.

    Hope it helps

  • Hi,

    Thx a lot, I think there are some apps to manage cross system.
    Yes you are right, it seems to be all of environment differ a little. I use Linaro, I'm going to check that.


Log in to reply