Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Error configuring Qt5 for compilation from source
QtWS25 Last Chance

Error configuring Qt5 for compilation from source

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
10 Posts 3 Posters 2.4k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    catx
    wrote on last edited by catx
    #1

    I am trying to compile Qt5 from source using the qt-everywhere-opensource-src-5.9.6.tar.xz file. I extract the file, and create the following qmake.conf:

    #
    # qmake configuration for building with arm-linux-gnueabi-g++
    #
    
    MAKEFILE_GENERATOR      = UNIX
    TARGET_PLATFORM         = unix
    TEMPLATE                = app
    CONFIG                  += qt warn_on release incremental link_prl gdb_dwarf_index
    QT                      += core gui
    QMAKE_INCREMENTAL_STYLE = sublib
    
    include(../common/linux.conf)
    include(../common/gcc-base-unix.conf)
    include(../common/g++-unix.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=hard
    QMAKE_CXXFLAGS_RELEASE = -O3 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=hard
    
    # modifications to g++.conf
    QMAKE_CC                = /{homedir}/gcc-linaro-7.3.1-2018.05-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc
    QMAKE_CXX               = /{homedir}/gcc-linaro-7.3.1-2018.05-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-g++
    QMAKE_LINK              = /{homedir}/gcc-linaro-7.3.1-2018.05-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-g++
    QMAKE_LINK_SHLIB        = /{homedir}/gcc-linaro-7.3.1-2018.05-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-g++
    
    # modifications to linux.conf
    QMAKE_AR                = /{homedir}/gcc-linaro-7.3.1-2018.05-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-ar cqs
    QMAKE_OBJCOPY           = /{homedir}/gcc-linaro-7.3.1-2018.05-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-objcopy
    QMAKE_STRIP             = /{homedir}/gcc-linaro-7.3.1-2018.05-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-strip
    
    load(qt_config)
    

    Next, I go inside the extracted qt folder and call ./configure with the following parameters:

    ./configure -v -opensource -confirm-license -prefix /{homedir}/qt-everywhere-opensource-src-5.9.6 -xplatform linux-arm-gnueabihf-g++ -embedded arm -little-endian -host-little-endian -no-qt3support -nomake demos -nomake examples -qt-gfx-linuxfb -qt-gfx-qvfb -qt-gfx-vnc -no-accessibility
    

    It runs for a while then throws me this error:

    Info: creating super cache file /{homedir}/qt-everywhere-opensource-src-5.9.6/.qmake.super
    ERROR: Invalid command line parameter 'arm'.
    

    Is this because of the -embedded arm option? I see many pages using it so I am not sure why I am getting this error. Please help.

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      From the looks of it, you are using options for cross-compiling Qt 4 some of which are not valid anymore for Qt 5.

      What is your current target ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • C Offline
        C Offline
        catx
        wrote on last edited by catx
        #3

        Hello SGaist,
        My current target is Beaglebone Black. I installed Qt 5.9.6 using the unified-linux file. I then ran this command:

        sudo apt-get install qtdeclarative5-dev qml-module-qtquick-controls
        

        There is a /bin/ folder inside my /usr/share/qt4, but my /usr/share/qt5 doesn't have one. Did I have Qt5 installed or no? Also, do I edit the /usr/share/qt4/mkspecs/linux-arm-gnueabi-g++/qmake.conf or do I make a copy elsewhere?

        When I edit my /usr/share/qt4/mkspecs/linux-arm-gnueabi-g++/qmake.conf as above and run this:

        configure -v -opensource -confirm-license -prefix /usr/local/qt-arm -xplatform linux-arm-gnueabi-g++
        

        This is what I get:

        + cd qtbase
        + /{homedir}/qt-everywhere-opensource-src-5.9.6/qtbase/configure -top-level -v -opensource -confirm-license -prefix /usr/local/qt-arm -xplatform linux-arm-gnueabi-g++
        Creating qmake...
        make: Nothing to be done for 'first'.
        Command line: -v -opensource -confirm-license -prefix /usr/local/qt-arm -xplatform linux-arm-gnueabi-g++
        Project ERROR: Cannot run target compiler 'arm-linux-gnueabi-g++'. Output:
        ===================
        sh: 1: arm-linux-gnueabi-g++: not found
        ===================
        Maybe you forgot to setup the environment?
        

        Can you tell me what went wrong? There are only arm-linux-gnueabihf-gcc inside my Linaro folder, not arm-linux-gnueabi-gcc. Not sure if that would help.

        Also, is there any recommended option for the ./configure? Thanks!!!!

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          First thing: don't mix your distribution provided Qt and the one you compile yourself. They are not related.

          Then where is linux-arm-gnueabi-g++ exactly ?

          There's also this wiki page on the subject.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          1
          • C Offline
            C Offline
            catx
            wrote on last edited by
            #5

            @SGaist said in Error configuring Qt5 for compilation from source:

            linux-arm-gnueabi-g++

            I don't have any linux-arm-gnueabi-g++. I only have linux-arm-gnueabihf-g++.

            1 Reply Last reply
            0
            • D Offline
              D Offline
              Delphi251189
              wrote on last edited by
              #6
              1. -no-qt3support available only on Qt4.x
              2. I don't sure that '-embedded arm', '-little-endian' ,and ' -host-little-endian' options are valid for Qt5: You can check it by typing configure --help. Make sure that all your provided parameters listed as valid options.
              3. '-xplatform linux-arm-gnueabihf-g++' option means that You must have 'linux-arm-gnueabihf-g++' folder in qtbase/mkspecs/devices/ directory which must contain qmake.conf and qplatformdefs.h files: check is it true?
              1 Reply Last reply
              1
              • C Offline
                C Offline
                catx
                wrote on last edited by
                #7

                @Delphi251189 , does (3) mean that I have to copy {home-dir}/{gcc-linaro}/bin with all its binaries into the qtbase/mkspecs/devices/ folder? What page specifies that requirements? Thanks.

                D 1 Reply Last reply
                0
                • C catx

                  @Delphi251189 , does (3) mean that I have to copy {home-dir}/{gcc-linaro}/bin with all its binaries into the qtbase/mkspecs/devices/ folder? What page specifies that requirements? Thanks.

                  D Offline
                  D Offline
                  Delphi251189
                  wrote on last edited by
                  #8

                  @catx
                  I have no idea about what actualy contains {home-dir}/{gcc-linaro}/bin.
                  Most likely it must contain g++ gcc and other gnu tools.
                  qtbase/mkspecs/ contains something different. for example qmake.conf for Raspberry Pi :

                  include(../common/linux_device_pre.conf)

                  QMAKE_LFLAGS += -Wl,-rpath-link,$$[QT_SYSROOT]/opt/vc/lib

                  QMAKE_LIBDIR_OPENGL_ES2 = $$[QT_SYSROOT]/opt/vc/lib
                  QMAKE_LIBDIR_EGL = $$QMAKE_LIBDIR_OPENGL_ES2

                  QMAKE_INCDIR_EGL = $$[QT_SYSROOT]/opt/vc/include
                  $$[QT_SYSROOT]/opt/vc/include/interface/vcos/pthreads
                  $$[QT_SYSROOT]/opt/vc/include/interface/vmcs_host/linux
                  QMAKE_INCDIR_OPENGL_ES2 = $${QMAKE_INCDIR_EGL}

                  QMAKE_LIBS_EGL = -lEGL -lGLESv2

                  contains(DISTRO, squeeze) {
                  #Debian Squeeze: Legacy everything
                  QMAKE_LIBS_OPENGL_ES2 = -lGLESv2 -lEGL
                  } else:contains(DISTRO, arch) {
                  #On principle: no wizardry required
                  } else {
                  #This is not strictly necessary
                  DISTRO_OPTS += deb-multi-arch
                  DISTRO_OPTS += hard-float
                  }

                  QMAKE_CFLAGS +=
                  -marm
                  -mfpu=vfp
                  -mtune=arm1176jzf-s
                  -march=armv6zk
                  -mabi=aapcs-linux

                  QMAKE_CXXFLAGS = $$QMAKE_CFLAGS

                  EGLFS_DEVICE_INTEGRATION = eglfs_brcm

                  include(../common/linux_arm_device_post.conf)

                  load(qt_config)

                  It just tells how to build Qt from sources.
                  What compiler will be used, what flags should passed to compiler, where are include lib files and other information. it does not contains compiler, linker or 3rdparty libs, it just tells where are they.

                  1 Reply Last reply
                  0
                  • C Offline
                    C Offline
                    catx
                    wrote on last edited by
                    #9

                    @Delphi251189 , yes {home-dir}/{gcc-linaro}/bin contains all the gcc, g++ and other GNU tools of the Linaro compiler.

                    1 Reply Last reply
                    0
                    • SGaistS Offline
                      SGaistS Offline
                      SGaist
                      Lifetime Qt Champion
                      wrote on last edited by
                      #10

                      What device are you targeting ?

                      Interested in AI ? www.idiap.ch
                      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                      1 Reply Last reply
                      0

                      • Login

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • Users
                      • Groups
                      • Search
                      • Get Qt Extensions
                      • Unsolved