Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. IGNORE THIS !!! file not recognized: File format not recognized

IGNORE THIS !!! file not recognized: File format not recognized

Scheduled Pinned Locked Moved C / C++ / MFC
linuxdebuggingtutorialquestion
6 Posts 2 Posters 1 Views 1 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.
  • V Offline
    V Offline
    Vaclav_
    wrote on last edited by
    #1

    THIS IS embarrassing SOMEHOW MY MAIN PROJECT BECAME PLAIN gcc I NEED TO REVERt BACK TO CROSSCOMPiled GCC! Build the library for ARM, easy task in Eclipse ( for a change). Still no go. missing some option. Never mind it is simple the library is compiled on x86 , now I need it to compile it for ARM. Any opposing opinions are welcome. I wish I could do it on x86. Any file .a ,or .so perfectly working , and linked using -l / -L , in GCC compiled application CANNOT be accessed in crosscompiled version of the SAME project. See attached highlighted part of the " make " output text.

    Building target: RPI_BT_CLIENT
    Invoking: Cross G++ Linker
    arm-linux-gnueabihf-g++ -L"/media/z/DEV_COPY_LABEL/ECLIPSE_FOLDER/2019-12/Eclipse_2019_12/eclipse/Workspace_2019_12/RPI_BT_LIB/Debug" -L/media/z/MISC_COPY_LABEL/RPI_library/lib -L"/media/z/DEV_COPY_LABEL/ECLIPSE_FOLDER/2019-12/Eclipse_2019_12/eclipse/Workspace_2019_12/LIB_SHARED/Debug" -
    ....
    bluetooth_sample_SDP.o -lbluetooth -lLIB_SHARED
    .....
    /media/z/DEV_COPY_LABEL/ECLIPSE_FOLDER/2019-12/Eclipse_2019_12/eclipse/Workspace_2019_12/LIB_SHARED/Debug/libLIB_SHARED.so: file not recognized: File format not recognized

    Does crosscompiler expect some other option ?? Please no more "how to use -l / -L"

    K 1 Reply Last reply
    0
    • V Vaclav_

      THIS IS embarrassing SOMEHOW MY MAIN PROJECT BECAME PLAIN gcc I NEED TO REVERt BACK TO CROSSCOMPiled GCC! Build the library for ARM, easy task in Eclipse ( for a change). Still no go. missing some option. Never mind it is simple the library is compiled on x86 , now I need it to compile it for ARM. Any opposing opinions are welcome. I wish I could do it on x86. Any file .a ,or .so perfectly working , and linked using -l / -L , in GCC compiled application CANNOT be accessed in crosscompiled version of the SAME project. See attached highlighted part of the " make " output text.

      Building target: RPI_BT_CLIENT
      Invoking: Cross G++ Linker
      arm-linux-gnueabihf-g++ -L"/media/z/DEV_COPY_LABEL/ECLIPSE_FOLDER/2019-12/Eclipse_2019_12/eclipse/Workspace_2019_12/RPI_BT_LIB/Debug" -L/media/z/MISC_COPY_LABEL/RPI_library/lib -L"/media/z/DEV_COPY_LABEL/ECLIPSE_FOLDER/2019-12/Eclipse_2019_12/eclipse/Workspace_2019_12/LIB_SHARED/Debug" -
      ....
      bluetooth_sample_SDP.o -lbluetooth -lLIB_SHARED
      .....
      /media/z/DEV_COPY_LABEL/ECLIPSE_FOLDER/2019-12/Eclipse_2019_12/eclipse/Workspace_2019_12/LIB_SHARED/Debug/libLIB_SHARED.so: file not recognized: File format not recognized

      Does crosscompiler expect some other option ?? Please no more "how to use -l / -L"

      K Offline
      K Offline
      k5054
      wrote on last edited by
      #2

      You're probably trying to link in an x86-64 version of the lib, not ARM.

      V 1 Reply Last reply
      0
      • K k5054

        You're probably trying to link in an x86-64 version of the lib, not ARM.

        V Offline
        V Offline
        Vaclav_
        wrote on last edited by
        #3

        and you are probably correct. I am getting this error

        lc -lgcc_s -lgcc /usr/lib/gcc/x86_64-linux-gnu/5/crtend.o /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crtn.o
        /usr/bin/ld: skipping incompatible /media/z/DEV_COPY_LABEL/ECLIPSE_FOLDER/2019-12/Eclipse_2019_12/eclipse/Workspace_2019_12/RPI_BT_LIB_ARM/Debug/libRPI_BT_LIB_ARM.a when searching for -lRPI_BT_LIB_ARM
        /usr/bin/ld: cannot find -lRPI_BT_LIB_ARM

        The error is little confusing - skipping and cannot find it - both ? And indeed my X86 is 64 bits and the RPI is 32. But it only bothers the additional library. I'll add -m32 and watch for smoke

        V K 2 Replies Last reply
        0
        • V Vaclav_

          and you are probably correct. I am getting this error

          lc -lgcc_s -lgcc /usr/lib/gcc/x86_64-linux-gnu/5/crtend.o /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crtn.o
          /usr/bin/ld: skipping incompatible /media/z/DEV_COPY_LABEL/ECLIPSE_FOLDER/2019-12/Eclipse_2019_12/eclipse/Workspace_2019_12/RPI_BT_LIB_ARM/Debug/libRPI_BT_LIB_ARM.a when searching for -lRPI_BT_LIB_ARM
          /usr/bin/ld: cannot find -lRPI_BT_LIB_ARM

          The error is little confusing - skipping and cannot find it - both ? And indeed my X86 is 64 bits and the RPI is 32. But it only bothers the additional library. I'll add -m32 and watch for smoke

          V Offline
          V Offline
          Vaclav_
          wrote on last edited by
          #4

          Bummer -m32 does not compute as ARM option

          1 Reply Last reply
          0
          • V Vaclav_

            and you are probably correct. I am getting this error

            lc -lgcc_s -lgcc /usr/lib/gcc/x86_64-linux-gnu/5/crtend.o /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crtn.o
            /usr/bin/ld: skipping incompatible /media/z/DEV_COPY_LABEL/ECLIPSE_FOLDER/2019-12/Eclipse_2019_12/eclipse/Workspace_2019_12/RPI_BT_LIB_ARM/Debug/libRPI_BT_LIB_ARM.a when searching for -lRPI_BT_LIB_ARM
            /usr/bin/ld: cannot find -lRPI_BT_LIB_ARM

            The error is little confusing - skipping and cannot find it - both ? And indeed my X86 is 64 bits and the RPI is 32. But it only bothers the additional library. I'll add -m32 and watch for smoke

            K Offline
            K Offline
            k5054
            wrote on last edited by
            #5

            Vaclav_ wrote:

            The error is little confusing - skipping and cannot find it - both ?

            Not really. The linker found a copy of the lib, but it has the wrong architechture, so it skipped over that one, but then did not find a suitable candidate. If you had x86, x86-64, PowerPC and MIPS versions of that lib, I expect you would get skipped messages for each. I notice you're calling /usr/bin/ld. If you are cross compiling for an rpi, should that be calling /usr/bin/arm-linux-guneeabihf-ld? I think maybe you've misconfigured your project to produce X86 output, and not ARM.

            V 1 Reply Last reply
            0
            • K k5054

              Vaclav_ wrote:

              The error is little confusing - skipping and cannot find it - both ?

              Not really. The linker found a copy of the lib, but it has the wrong architechture, so it skipped over that one, but then did not find a suitable candidate. If you had x86, x86-64, PowerPC and MIPS versions of that lib, I expect you would get skipped messages for each. I notice you're calling /usr/bin/ld. If you are cross compiling for an rpi, should that be calling /usr/bin/arm-linux-guneeabihf-ld? I think maybe you've misconfigured your project to produce X86 output, and not ARM.

              V Offline
              V Offline
              Vaclav_
              wrote on last edited by
              #6

              I am sorry. Yes, I got it all mixed up as far as architecture. . From the start of this project I did not like terms "server / client". Now I got caught in my own trap. I am renaming my projects RPI_BT_SERVER_X86 - runs on PC X86-64 RPI_BT_CLIENT_ARM runs on ARM7 32 bits Cheers

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups