Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. Qt Creator to use Desktop kit get Error with: “Application finished with exit code 126.”

Qt Creator to use Desktop kit get Error with: “Application finished with exit code 126.”

Scheduled Pinned Locked Moved Unsolved Installation and Deployment
6 Posts 2 Posters 1.7k 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.
  • SoheilSabzS Offline
    SoheilSabzS Offline
    SoheilSabz
    wrote on last edited by SoheilSabz
    #1

    I am using the QT Creator for my laptop (Linux LMDE 3 Cindy OS) And for Raspberry Cross-compiling.

    I have installed the QT based of this instruction and by this setting:

        mkdir ~/raspi
        cd ~/raspi
        git clone https://github.com/raspberrypi/tools
        mkdir sysroot sysroot/usr sysroot/opt
    
        rsync -avz pi@raspberrypi_ip:/lib sysroot
        rsync -avz pi@raspberrypi_ip:/usr/include sysroot/usr
        rsync -avz pi@raspberrypi_ip:/usr/lib sysroot/usr
        rsync -avz pi@raspberrypi_ip:/opt/vc sysroot/opt
    wget http://download.qt.io/official_releases/qt/5.12/5.12.3/single/ qt-everywhere-src-5.12.3.tar.xz
    tar xvf  qt-everywhere-src-5.12.3.tar.xz
    cd  qt-everywhere-src-5.12.3
    

    ./configure -release -opengl es2 -device linux-rasp-pi-g++
    -device-option CROSS_COMPILE=~/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf-
    -sysroot ~/raspi/sysroot -opensource -confirm-license -skip qtwayland -skip qtlocation -skip qtscript -make libs -prefix /usr/local/qt5pi -extprefix ~/raspi/qt5pi -hostprefix ~/raspi/qt5 -no-use-gold-linker -v -no-gbm

        make
        make install
    

    but when i go to my QT Creator and i have built a sample Qt Widget Application.
    My desktop2.pro file is this kind:

    #-------------------------------------------------
    #
    # Project created by QtCreator 2019-05-29T19:53:02
    #
    #-------------------------------------------------
    
    QT       += core gui
    
    greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
    
    TARGET = desktop2
    TEMPLATE = app
    
    # The following define makes your compiler emit warnings if you use
    # any feature of Qt which has been marked as deprecated (the exact warnings
    # depend on your compiler). Please consult the documentation of the
    # deprecated API in order to know how to port your code away from it.
    DEFINES += QT_DEPRECATED_WARNINGS
    
    # You can also make your code fail to compile if you use deprecated APIs.
    # In order to do so, uncomment the following line.
    # You can also select to disable deprecated APIs only up to a certain version of Qt.
    #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs deprecated before Qt 6.0.0
    
    CONFIG += c++11
    
    SOURCES += \
            main.cpp \
            mainwindow.cpp
    
    HEADERS += \
            mainwindow.h
    
    FORMS += \
            mainwindow.ui
    
    # Default rules for deployment.
    qnx: target.path = /tmp/$${TARGET}/bin
    else: unix:!android: target.path = /home/so/Desktop/trash/desktop1/$${TARGET}/bin
    !isEmpty(target.path): INSTALLS += target
    

    SO when i want to use my Desktop Kit and want to run it in my PC (not in Raspberry), i get this Error:

    20:46:55: Starting /home/so/Desktop/trash/desktop1/desktop2/bin/desktop2 ...
    bash: /home/so/Desktop/trash/desktop1/desktop2/bin/desktop2: cannot execute binary file: Exec format error
    bash: /home/so/Desktop/trash/desktop1/desktop2/bin/desktop2: Success
    20:46:55: Application finished with exit code 126.
    

    My Qt Version is shown Below:
    enter image description here

    My Desktop kit setting is shown blown:
    Desktop kit setting

    AND my Desktop PC SS Device setting is shown below:

    Desktop PC SS Device setting

    AND My GCC Compiler setting shown below:
    GCC Compiler setting

    AND My qt Raspberry Compiler setting is shown Below:
    enter image description here

    • My Guesses is there is some conflict between The GCC Compiler AND Qt
      Version Which is V 5.12.3. So must i use lower Qt version?
    • Or i Must install again that qt Version at new folder with new
      Configuration setting?
    • Or what any other recommendation?

    My this question link at Stack-exchange community:
    https://superuser.com/questions/1443812/%d9%92qt-creator-error-with-application-finished-with-exit-code-126

    UPDATE: Near the Desktop kit name in Qt Creator GUI there is one red caution mark which when i hover my mouse on it show this information:

    Error: The compiler "GCC

    by this error:

    Error: The compiler "GCC (C++,X86 64bit in /usr/bin)" (X86-linux-generic-elf-64bit) cannot produce code for the Qt Version "Qt 5.12.3 (qt5)" (arm-linux-generic-elf-32bit).
    

    Thanks a lot.

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

      Hi and welcome to devnet,

      There's a red icon beside your desktop Kit. What does it tell you when you hover it.

      Your setup looks a bit strange, it makes it look as if you are using your desktop machine as a device from your Pi. Which is usually the other way around.

      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
      • SoheilSabzS Offline
        SoheilSabzS Offline
        SoheilSabz
        wrote on last edited by
        #3

        Near the Desktop kit name in Qt Creator GUI there is one red caution mark which when i hover my mouse on it show this information:

        Error: The compiler "GCC

        by this error:

        Error: The compiler "GCC (C++,X86 64bit in /usr/bin)" (X86-linux-generic-elf-64bit) cannot produce code for the Qt Version "Qt 5.12.3 (qt5)" (arm-linux-generic-elf-32bit).
        
        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          From the looks of it you are mixing stuff quite strangely.

          Why are you trying to use an ARM build of Qt with your desktop x86_64 compiler ? If you want to cross-compile for your target, then you need a cross-compiler in the first place.

          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
          • SoheilSabzS Offline
            SoheilSabzS Offline
            SoheilSabz
            wrote on last edited by
            #5

            @SGaist said in Qt Creator to use Desktop kit get Error with: “Application finished with exit code 126.”:

            ARM build of Qt

            Excuses me i am confused, i know the cross-compiling is to write code in my Linux OS and run in for example my Raspberry, but as i mentioned i don't want to do this now i need to test my codes via my laptop Linux OS ( (Via Desktop Kit). So how could i do that? must i install new qt v5.12.3 with new configuration?, or could i use new GCC compiler setting to for my Desktop Kit?

            Excuses me i am newbie in Qt.

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

              No, you can use your distribution provided Qt. However it's a good idea to keep in sync with the version you are going to use to cross-compile.

              From the looks of it, you tried to use your cross-compiled Qt with your desktop compiler. Hence your error.

              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

              • Login

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