IGNORE THIS !!! file not recognized: File format not recognized
-
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 recognizedDoes crosscompiler expect some other option ?? Please no more "how to use -l / -L"
-
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 recognizedDoes crosscompiler expect some other option ?? Please no more "how to use -l / -L"
-
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_ARMThe 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
-
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_ARMThe 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
-
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_ARMThe 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
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.
-
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.
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