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. File not recognized: File format not recognized error
Forum Updated to NodeBB v4.3 + New Features

File not recognized: File format not recognized error

Scheduled Pinned Locked Moved Unsolved Installation and Deployment
15 Posts 5 Posters 22.8k Views 2 Watching
  • 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.
  • T this

    @jsulm Yes, cross-compile right.
    So the compiler
    / root / crosscompile-tools / tools / arm-bcm2708 / gcc-linaro-arm-linux-gnueabihf-raspbian-x64 / bin / arm-linux-gnueabihf-g ++
    .
    What do you need to do more?

    jsulmJ Offline
    jsulmJ Offline
    jsulm
    Lifetime Qt Champion
    wrote on last edited by
    #6

    @this As I said: you need to cross compile Qt. The Qt you have on your Ubuntu machine is for x86_64 not ARM.

    https://forum.qt.io/topic/113070/qt-code-of-conduct

    T 1 Reply Last reply
    0
    • jsulmJ jsulm

      @this As I said: you need to cross compile Qt. The Qt you have on your Ubuntu machine is for x86_64 not ARM.

      T Offline
      T Offline
      this
      wrote on last edited by this
      #7

      @jsulm said in File not recognized: File format not recognized error:

      cross compile Qt

      sorry but,
      I do not understand well.
      I have installed everything related to cross compile
      What do I need to do to set up arm cross compilation in qt?

      jsulmJ 1 Reply Last reply
      0
      • T this

        @jsulm said in File not recognized: File format not recognized error:

        cross compile Qt

        sorry but,
        I do not understand well.
        I have installed everything related to cross compile
        What do I need to do to set up arm cross compilation in qt?

        jsulmJ Offline
        jsulmJ Offline
        jsulm
        Lifetime Qt Champion
        wrote on last edited by jsulm
        #8

        @this If you want to write Qt applications for your target device then you need Qt built for that device.
        "I have installed everything related to cross compile" - what about Qt? Does your cross compilation set-up contain Qt for your target device? You cannot use your Ubuntu Qt packages for your target device as those are compiled for x86_64 not ARM.
        What exactly did you install?
        There is a description how to cross compile Qt for RaspberryPi: http://wiki.qt.io/Raspberry_Pi_Beginners_Guide

        https://forum.qt.io/topic/113070/qt-code-of-conduct

        T 1 Reply Last reply
        1
        • jsulmJ jsulm

          @this If you want to write Qt applications for your target device then you need Qt built for that device.
          "I have installed everything related to cross compile" - what about Qt? Does your cross compilation set-up contain Qt for your target device? You cannot use your Ubuntu Qt packages for your target device as those are compiled for x86_64 not ARM.
          What exactly did you install?
          There is a description how to cross compile Qt for RaspberryPi: http://wiki.qt.io/Raspberry_Pi_Beginners_Guide

          T Offline
          T Offline
          this
          wrote on last edited by
          #9

          @jsulm I have completed installation related to crosscompile.
          I created a new project and proceeded with the build.
          I also confirmed that an executable file is created in raspberry pi. I also confirmed that debugging is going well.

          So the crosscompile completed successfully.

          By the way,
          I have a problem when I crosscompile qt that I have already worked on (ubuntu qt)
          Can not I crosscompile the qt I've been working on?

          jsulmJ 1 Reply Last reply
          0
          • T this

            @jsulm I have completed installation related to crosscompile.
            I created a new project and proceeded with the build.
            I also confirmed that an executable file is created in raspberry pi. I also confirmed that debugging is going well.

            So the crosscompile completed successfully.

            By the way,
            I have a problem when I crosscompile qt that I have already worked on (ubuntu qt)
            Can not I crosscompile the qt I've been working on?

            jsulmJ Offline
            jsulmJ Offline
            jsulm
            Lifetime Qt Champion
            wrote on last edited by jsulm
            #10

            @this Sorry, now I'm completely lost! Can you please clearly explain what you are really doing? You were talking about Qt from Ubuntu which you installed, now you say you're building on RaspberryPi. Are you building on RaspberryPi for RaspberryPi (which isn't cross compilation), or do you want to build on RaspberryPi for your Ubuntu PC?
            If you're crsoss compiling from RaspberryPi to Ubuntu then why do you use ARM cross compiler?

            "I have completed installation related to crosscompile" - what did you install and where?

            "I have a problem when I crosscompile qt that I have already worked on (ubuntu qt)
            Can not I crosscompile the qt I've been working on?" - I don't know what you mean.

            https://forum.qt.io/topic/113070/qt-code-of-conduct

            T 1 Reply Last reply
            0
            • jsulmJ jsulm

              @this Sorry, now I'm completely lost! Can you please clearly explain what you are really doing? You were talking about Qt from Ubuntu which you installed, now you say you're building on RaspberryPi. Are you building on RaspberryPi for RaspberryPi (which isn't cross compilation), or do you want to build on RaspberryPi for your Ubuntu PC?
              If you're crsoss compiling from RaspberryPi to Ubuntu then why do you use ARM cross compiler?

              "I have completed installation related to crosscompile" - what did you install and where?

              "I have a problem when I crosscompile qt that I have already worked on (ubuntu qt)
              Can not I crosscompile the qt I've been working on?" - I don't know what you mean.

              T Offline
              T Offline
              this
              wrote on last edited by this
              #11

              @jsulm I do not speak English well.
              So I use a translator.
              So it seems that there is a problem in communication.

              I'm proceeding with 'ubuntu-> raspberrypi'.

              The following homepage is an item installed to crosscompile.
              Https://medium.com/@amirmann/how-to-cross-compile-qt-for-raspberry-pi-3-on-linux-ubuntu-for-beginners-75acf2a078c

              A new project was created and cross-compiled successfully.
              Executable file created in rasspberry pi.
              Debugging went well.

              By the way,
              I tried to crosscompile a project that was working with qt on ubuntu pc in the past.

              So I want to crosscompile with raspberry pi the project I worked on in the past.
              However, the above error occurs.

              I want to build the qt that I worked on in the past with cross-compiled qt.

              I'm sorry I'm not good at English.
              I do not know if it was delivered properly. Sorry.

              jsulmJ 1 Reply Last reply
              0
              • T this

                @jsulm I do not speak English well.
                So I use a translator.
                So it seems that there is a problem in communication.

                I'm proceeding with 'ubuntu-> raspberrypi'.

                The following homepage is an item installed to crosscompile.
                Https://medium.com/@amirmann/how-to-cross-compile-qt-for-raspberry-pi-3-on-linux-ubuntu-for-beginners-75acf2a078c

                A new project was created and cross-compiled successfully.
                Executable file created in rasspberry pi.
                Debugging went well.

                By the way,
                I tried to crosscompile a project that was working with qt on ubuntu pc in the past.

                So I want to crosscompile with raspberry pi the project I worked on in the past.
                However, the above error occurs.

                I want to build the qt that I worked on in the past with cross-compiled qt.

                I'm sorry I'm not good at English.
                I do not know if it was delivered properly. Sorry.

                jsulmJ Offline
                jsulmJ Offline
                jsulm
                Lifetime Qt Champion
                wrote on last edited by
                #12

                @this said in File not recognized: File format not recognized error:

                Executable file created in rasspberry pi.

                You probably mean FOR RaspberryPi not IN.

                In the first post you wrote:
                "< Error >
                File not recognized: File format not recognized
                /lib/x86_64-linux-gnu/libgcc_s.so.1
                Collect2: error: ld returned 1 exit status"
                This looks to me like you're trying to use your Ubuntu x86_64 Qt to cross compile for RaspberryPi. This cannot work. You need to use your cross compiled Qt.

                https://forum.qt.io/topic/113070/qt-code-of-conduct

                T 1 Reply Last reply
                1
                • jsulmJ jsulm

                  @this said in File not recognized: File format not recognized error:

                  Executable file created in rasspberry pi.

                  You probably mean FOR RaspberryPi not IN.

                  In the first post you wrote:
                  "< Error >
                  File not recognized: File format not recognized
                  /lib/x86_64-linux-gnu/libgcc_s.so.1
                  Collect2: error: ld returned 1 exit status"
                  This looks to me like you're trying to use your Ubuntu x86_64 Qt to cross compile for RaspberryPi. This cannot work. You need to use your cross compiled Qt.

                  T Offline
                  T Offline
                  this
                  wrote on last edited by
                  #13

                  @jsulm Thank you.
                  I solved the problem.
                  I typed LIBS + = -L / lib / x86_64-linux-gnu / -lz in my .pro file
                  I modified it for arm, and it builds well.
                  Thank you for your help.

                  O 1 Reply Last reply
                  0
                  • T this

                    @jsulm Thank you.
                    I solved the problem.
                    I typed LIBS + = -L / lib / x86_64-linux-gnu / -lz in my .pro file
                    I modified it for arm, and it builds well.
                    Thank you for your help.

                    O Offline
                    O Offline
                    oswaldopr
                    wrote on last edited by
                    #14

                    @this excuse me, I have the same problem, I’m trying to complie in my raspberry pi, and the same error appears, I’m using a dynamic library (.so) and it seems that the problem its with the linker step, I see that you resolved the problem with that comand line, but Can you explain me more how to use that line? Thanks a lot !!

                    Pablo J. RoginaP 1 Reply Last reply
                    0
                    • O oswaldopr

                      @this excuse me, I have the same problem, I’m trying to complie in my raspberry pi, and the same error appears, I’m using a dynamic library (.so) and it seems that the problem its with the linker step, I see that you resolved the problem with that comand line, but Can you explain me more how to use that line? Thanks a lot !!

                      Pablo J. RoginaP Offline
                      Pablo J. RoginaP Offline
                      Pablo J. Rogina
                      wrote on last edited by
                      #15

                      @oswaldopr said in File not recognized: File format not recognized error:

                      I’m trying to complie in my raspberry pi, and the same error appears, I’m using a dynamic library (.so)

                      You need to be sure the .so file you're using is for the right platform (i.e. ARM)

                      Upvote the answer(s) that helped you solve the issue
                      Use "Topic Tools" button to mark your post as Solved
                      Add screenshots via postimage.org
                      Don't ask support requests via chat/PM. Please use the forum so others can benefit from the solution in the future

                      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