Qmake configuration for building with arm-linux-g++ with imx6 linaro



  • i have install qmake, cross compiler, qt open source, buildroot
    How to use qmake to link buildroot, cross compiler and qtcreator together?

    i tried creating new kit in Qtcreator. It has a big red exclaimation.
    I left Device, Sysroot and Qt mkspec empty because i do not know what to fill in.


  • Lifetime Qt Champion

    Hi,

    Did you first cross-compile Qt 5 ?



  • i did. below is my steps. Pls advice
    How does buildroot comes into picture??

    Below is the information on how I setup QT environment for building imx6 application.

    1. My environment

    lsb_release –a

    • Host: Ubuntu 12.04.5 LTS
    • Release: 12.04
    • Codename: precise
    • QT version

    .qmake -version

    • Qmake version 2.01a
    • Using Qt version 4.8.1 in /usr/lib/i386-linux-gnu

    1. Cross-compiler1 path(arm-linux-gnueabihf g++) for Qtcreator
      /opt/gcc-linaro-arm-linux-gnueabihf-4.7.2013-20130313_linux/bin/arm-linux-gnueabihf g++
      Cross-compiler2 path (arm-none-gnueabi-gcc-4.3.3 g++) for Qtcreator
      /opt/codesourcery/arm-2009q1/bin/arm-none-gnueabi-gcc-4.3.3

    2. Configuring qmake.conf to work with cross compiler

    qmake configuration for building with arm-none-linux-gnueabi-g++

    MAKEFILE_GENERATOR = UNIX
    CONFIG += incremental gdb_dwarf_index
    QMAKE_INCREMENTAL_STYLE = sublib

    #INCPATH +=
    /usr/arm-linux-gnueabi/include

    INCPATH
    #/opt/codesourcery/arm-none-linux-gnueabi/include
    /opt/gcc-linaro-arm-linux-gnueabihf-4.7-2013.03-20130313_linux/arm-linux-gnueabihf/include

    include(../../common/g++.conf)
    include(../../common/gcc-base-unix.conf)
    include(../../common/linux.conf)
    include(../../common/qws.conf)

    #Compiler Flags to take advantage of the ARM architecture
    QMAKE_CFLAGS_RELEASE = -O3 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp
    QMAKE_CXXFLAGS_RELEASE = -O3 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp

    modifications to g++.conf

    QMAKE_CC = /opt/gcc-linaro-arm-linux-gnueabihf-4.7-2013.03-20130313_linux/arm-linux-gnueabihf/arm-none-linux-gnueabi-gcc
    QMAKE_CXX = /opt/gcc-linaro-arm-linux-gnueabihf-4.7-2013.03-20130313_linux/arm-linux-gnueabihf/arm-none-linux-gnueabi-g++
    QMAKE_LINK = /opt/gcc-linaro-arm-linux-gnueabihf-4.7-2013.03-20130313_linux/arm-linux-gnueabihf/arm-none-linux-gnueabi-g++
    QMAKE_LINK_SHLIB = /opt/gcc-linaro-arm-linux-gnueabihf-4.7-2013.03-20130313_linux/arm-linux-gnueabihf/arm-none-linux-gnueabi-g++

    modifications to linux.conf

    QMAKE_AR = /opt/gcc-linaro-arm-linux-gnueabihf-4.7-2013.03-20130313_linux/arm-linux-gnueabihf/arm-none-linux-gnueabi-ar cqs
    QMAKE_OBJCOPY = /opt/gcc-linaro-arm-linux-gnueabihf-4.7-2013.03-20130313_linux/arm-linux-gnueabihf/arm-none-linux-gnueabi-objcopy
    QMAKE_STRIP = /opt/gcc-linaro-arm-linux-gnueabihf-4.7-2013.03-20130313_linux/arm-linux-gnueabihf/arm-none-linux-gnueabi-strip

    load(qt_config)

    #-----------------------------------------------------------------------------

    #/home/common/Desktop/qt-opensource/qt-everywhere-opensource-src-4.7.3/mkspecs

    export DISPLAY=:0
    #export QT_QWS_FONTDIR=/opt/

    1. Build and install
      $ make –j 4
      $ sudo make install

    2. Configure Compiler
      Build & Run ->Compilers and click Add-> GCC
      Select compiler path:
      opt/gcc-linaro-arm-linux-gnueabihf-4.7.2013-20130313_linux/bin/arm-linux-gnueabihf g++

    1. Configure Kit
      Kits and click add
      Call new kit sabrelite
      • Name: ARM g++
      • Device type: Generic Linux Device
      • Sysroot: opt/gcc-linaro-arm-linux-gnueabihf-4.7.2013-20130313_linux/bin/arm-linux-gnueabihf g++
      • Compiler: arm-linux-gnueabihf g++
      • Qt version: Qt 5.3.0 GCC 32 bit
      • Qt mkspec: leave empty
    1. Build Qt Application
      Create new project (console)
      Edit project (.pro) file
      Target.path =/home/root
      INSTALL =target

  • Lifetime Qt Champion

    Which qmake are you using ? The one from your system Qt or the one you cross-built ?



  • qmake on pc for the system. qmake amendment as above for the target, of course??
    you did not answer first question. Can you write more for me to understand your thought, thought process, to absorb some of your know-how



  • It is not working on my target. Pls advice


  • Lifetime Qt Champion

    There's something absolutely not clear about your setup, there's Qt 5.3.0 Qt 4.8.1 and 4.7.3 mentioned in there.

    Which version of Qt do you want to use on your target, which one did you install on your system ? How did you install it ?



  • Hi

    I will announced my steps in another day, they are proven working until i put the image into target.

    I did succeed putting the image into target. But in the target, when i touch my dialog boxes. it is removed/deleted reviewing the background. What did i done wrongly. do i need Tslib to be installed to enable touchscreen.


  • Lifetime Qt Champion

    I can't answer that, I don't know your software or how it is supposed to run



  • My video has been published at http://youtu.be/LIgq7m1fU5A. Please kindly take a look. And what information i need to discosed



  • Below is my build process
    Building and setting up QT environment for IMX 6

    1. Set cross compile path

    export PATH=$PATH:/opt/freescale/usr/local/gcc-4.6.2-glibc-2.13-linaro-multilib-2011.12/fsl-linaro-toolchain/bin/

    arm-none-linux-gnueabi-gcc -v

    You will see “gcc version 4.6.2 20110630 (prerelease) (Freescale MAD -- Linaro 2011.07 -- Built at 2011/08/10 09:20)” at last line

    1. In your qt-everywhere-opensource-src-4.7.4
      Modify mkspecs/qws/linux-arm-g++/qmake.conf
      QMAKE_CC = arm-none-linux-gnueabi-gcc
      QMAKE_CXX = arm-none-linux-gnueabi-g++
      QMAKE_LINK = arm-none-linux-gnueabi-g++
      QMAKE_LINK_SHLIB = arm-none-linux-gnueabi-g++
      QMAKE_AR = arm-none-linux-gnueabi-ar cqs
      QMAKE_OBJCOPY = arm-none-linux-gnueabi-objcopy
      QMAKE_STRIP = arm-none-linux-gnueabi-strip
    2. In your qt-everywhere-opensource-src-4.7.4

    ./configure -embedded arm -qt-zlib -qt-libpng -qt-gif -qt-libtiff -qt-libmng -qt-libjpeg -qt-freetype -no-openssl -static -prefix /media/jt_disk2/QT

    “/media/jt_disk2/QT” is my QT install path

    1. make
    2. make install
      Building your code to target board
    3. Set environment variable

    export QTDIR=/media/jt_disk2/QT/

    export PATH=$QTDIR/bin:$PATH

    export LD_LIBRARY_PATH=$QTDIR/lib:$LD_LIBRARY_PATH

    qmake -version

    You will see QT version and QT in your install path

    1. In your code dir

    qmake -project

    qmake

    make

    1. Copy binary file to target board
    2. Copy ${QT install}/lib/fonts to target board's /usr/lib/
    3. export QT_QWS_FONTDIR=/usr/lib/fonts
    4. Run QT binary file

    ./Your_QT -qws


  • Lifetime Qt Champion

    Before anything else, if you're not tied to that particularly old version of Qt you should first update to 4.8.6


Log in to reply
 

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