Qt Creator - setting up a kit with a cross-compiler



  • Help.. I'm somewhat new to QT. I've built and run applications on windows as well as in a virtual machine on windows running ubuntu linux, and built the same application on the linux target.

    I'm trying to setup QT so I can cross-compile for a debian linux target running an armv5tejl type of processor. I also want to remote debug the linux target from my Windows PC. Is this possible?

    I've read countless forum and google posts and all of the QT online documentation and it is thoroughly confusing. The examples are all specific, mostly linux only, or very cryptic.

    I have a regular QT 5.5.1 Windows installation and can build and run my application there, runs fine. I have QT on the target linux machine. I can transfer my files to the target and build there OK but it gives a segmentation error.

    I've tried downloading QT source and the GCC compiler and was able to build a version of QT for the target architecture, I think....

    I'm unable to configure a kit for the target. What exactly goes into QT mkspec and sysroot in Build and Run - Kits?

    I've seen lots of things with complicated qmake.conf files etc. Do I have to manually edit one for my specific setup? The ones I found in the
    C:\Qt\qt-everywhere-opensource-src-5.5.1\qtbase\mkspecs directory from the downloaded QT source I have don't seem very complicated compared to the ones I've seen on various forums...

    I also once tried to setup Debian Linux in a VirtualBox VM on my PC as an alternative environment. I can install a base version of it and it boots, but anything beyond that fails on installation...

    Sorry to be so long winded,...


  • Lifetime Qt Champion

    Hi and welcome to devnet,

    So you do have a cross-compiled Qt ? If so, did you already build something with it from the command line ? If yes then it should be enough to add that Qt to the available Qt Version. You may have to add the cross-compiler you used to the list of compilers (next to Qt Version).
    Then you should only have to create a new Kit and point it to the cross-compiled Qt Version you just added and possibly the cross-compiler.



  • @SGaist

    The keywords in my post were :
    I've tried downloading QT source and the GCC compiler and was able to build a version of QT for the target architecture, I think....

    The "I think" for sure....

    here is what I tried....

    1.) downloaded gcc complier and installed GNU Tools ARM Embedded\5.2 2015q4

    2.) downloaded QT Source and unzipped: C:\Qt\qt-everywhere-opensource-src-5.5.1

    3.) Use cmd to open window and cd to C:\Qt\qt-everywhere-opensource-src-5.5.1

    4.) run configure......
    configure -platform win32-g++ -xplatform linux-g++-32
    builds QT but gets:
    Could not find output file 'arch.exe' or 'arch' in C:/Qt/qt-everywhere-opensource-src-5.5.1/qtbase/config.tests/arch : No such file or directory

    5.) in the C:\Qt\qt-everywhere-opensource-src-5.5.1\qtbase\config.tests\arch directory
    open the QT project file and build it. It produces arch.exe in the directory C:\Qt\qt-everywhere-opensource-src-5.5.1\qtbase\config.tests\arch-Debug don;t know what, if any of the #ifdefs are actually defined....

    6.) copy the arch.exe there and put it in the C:/Qt/qt-everywhere-opensource-src-5.5.1/qtbase/config.tests/arch directory

    7.) rerun configure -platform win32-g++ -xplatform linux-g++-32
    now it completes and generates a bunch of stuff in C:/Qt/qt-everywhere-opensource-src-5.5.1/qtbase

    8.) Add the gcc compiler to the list of compilers in QT (instructions - search for Adding Compilers in QT help Index)

    So, no, I don't know if the above actually produced anything specific for an arm target

    The next problem I get when trying to use it is it I have
    QT += core serialport in my project file and the "new" setup can't find them.
    I tried building them without any success.


  • Lifetime Qt Champion

    Something's not clear here. Are you trying to cross-compile from Windows to a x86(_64) Linux system ? Or to cross-compile for ARM ?



Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.