Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Error configuring Qt5 for compilation from source



  • 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.


  • Lifetime Qt Champion

    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 ?



  • 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!!!!


  • Lifetime Qt Champion

    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.



  • @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. -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?


  • @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.



  • @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.



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


  • Lifetime Qt Champion

    What device are you targeting ?


Log in to reply