Cross compile Qt application

  • Hi everyone,

    I have a desktop computer running Ubuntu with all of the Qt dev tools installed from the repositories. I also have an i.MX6 board running Ubuntu, and I've installed the Qt libraries using the repositories on that board as well.

    If I build an application on the i.MX6, there are no problems. What I'd like to do is build the application on my desktop and copy the binary onto the i.MX6. I've created a copy of the i.MX6's filesystem on my desktop so I can link against the libraries, and I've installed arm-linux-gnueabihf-g++ and created a qmake.conf file, but I'm getting errors when trying to build the project:

    ../../i.MX6/filesystem/usr/include/features.h:324:26: fatal error: bits/predefs.h: No such file or directory
    #include <bits/predefs.h>
    compilation terminated.
    make: *** [main.o] Error 1

    Here's the qmake.conf that I'm using:

    #qmake configuration for building with arm-linux-gnueabihf-g++

    TEMPLATE = app
    CONFIG += qt warn_on release incremental link_prl gdb_dwarf_index
    QT += core gui


    #modifications to g++.conf
    QMAKE_CC = arm-linux-gnueabhfi-gcc
    QMAKE_CXX = arm-linux-gnueabihf-g++
    QMAKE_LINK = arm-linux-gnueabihf-g++
    QMAKE_LINK_SHLIB = arm-linux-gnueabihf-g++

    #modifications to linux.conf
    QMAKE_AR = arm-linux-gnueabihf-ar cr
    QMAKE_OBJCOPY = arm-linux-gnueabihf-objcopy
    QMAKE_STRIP = arm-linux-gnueabihf-strip

    QMAKE_LFLAGS_RELEASE = -Wl,-O1,-rpath /home/marlon/i.MX6/filesystem/usr/lib
    QMAKE_INCDIR = /home/marlon/i.MX6/filesystem/usr/include
    QMAKE_LIBDIR = /home/marlon/i.MX6/filesystem/usr/lib


    Can anyone help me out with this?



  • Hi, i also encountered the same error sometime back, in fact i encountered many other errors also. Downloading the latest stable version of the QT source code resolved all my issues.

Log in to reply

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