File not recognized: File format not recognized error
-
@ambershark
Do you want to run the compiler and debugger in 64bit?
I did that.
I've also run 32bit, and I've run 64bit.
But the same error occurs.I do not understand well.
Could you explain more? -
@this You are cross compiling, right? In this case you need a cross compiled Qt (built with the same cross compiler).
lib/x86_64-linux-gnu/libgcc_s.so.1 - this is for x86_64 architecture
/root/crosscompile-tools/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf-g++ - this is for ARM
ARM != x86_64 -
-
@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 -
@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? -
@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. -
@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-75acf2a078cA 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. -
@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. -
@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 !!
-
@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)