Solved WiringPi build error
-
@this No, that's not what I mean.
What I mean: you need to use ARM build of libwiringPi for RPi.
Can you please try what I asked before?
What does (executed in a terminal)file /usr/local/lib/libwiringPi.so
say?
This line is wrong in many ways:
#LIBS + = -L / usr / local / lib /libwiringPi.so
First: it is commented out. Second: the path contains spaces. Third: you're using LIBS wrongly, it must be:
LIBS+=-L/usr/local/lib -lwiringPi
-
@jsulm Sorry, but I did not understand.
Do you want to type "file /usr/local/lib/libwiringPi.so" in the terminal?I entered the following results
/usr/local/lib/libwiringPi.so:symbolic link to libwiringPi.so.2.44
-
-
@jsulm I entered 'file /usr/local/lib/libwiringPi.so.2.44' in the terminal.
I got the following results./usr/local/lib/libwiringPi.so.2.44: ELF 32-bit LSB shared object, ARM, EABI5 version 1 (SYSV), dynamically linked, BuildID [sha1] = 13145f24d2081640dbda7cfb4d9648ceea0a77d6, not stripped
I modified the LIBS as you said.
But there are still errors. -
@this Which errors?
-
@jsulm It is the same error as the first inquiry.
"file not recognized:file format not recognized
/usr/local/lib/libwiringPi.so
collect2:error:ld returned 1 exit status" -
@this Did you rerun qmake after fixing LIBS in pro file?
-
@jsulm Yes, of course.
I also run rebuild.
However, the same error occurs. -
@this Can you show your pro file and the build log? Are you actually building for ARM?
-
@jsulm ![alt text](image url)
Do you need more information?
-
@this Yes, I need the build log ("Compile Output" tab in QtCreator)
-
@jsulm ![alt text](image url)
I am cross compiling Linux (ubuntu) to raspberrypi.
-
@this The lib is EABI5: "ELF 32-bit LSB shared object, ARM, EABI5". I think RPi uses EABI7 or something. From where did you get the lib?
-
@jsulm I'm sorry, but I do not know what lib is.
I can not understand your words.
Are you referring to qt lib?
Are you talking raspberrypi?We have installed cross compile environment by referring to the following site.
https://medium.com/@amirmann/how-to-cross-compile-qt-for-raspberry-pi-3-on-linux-ubuntu-for-beginners-75acf2a078c -
@this I'm talking about libwiringPi.so
How did you install this lib? Was it part of this cross compiling environment or did you get it from somewhere else? -
@jsulm I am sorry.
Installed.
The installation process is as follows:git clone git://git.drogon.net/wiringPi
cd wiringPi/
git pull origin
./buildAt first we installed wiringPi from ubuntu pc.
However, I got the error like above and installed raspberrypi in the same way. -
@this Sorry can you explain this: "At first we installed wiringPi from ubuntu pc.
However, I got the error like above and installed raspberrypi in the same way."Do you mean you built it on the RaspberryPi and copied then to your Ubuntu PC?
You should build it on your Ubuntu machine, but use the cross compilation environment. -
@jsulm Well ... you seem to have misunderstood.
The build is ubuntu -> raspberrypi. (Cross compile)I have been struggling to eliminate the errors that have occurred.
I first installed wiringPi via the terminal from ubuntu pc.
However, I thought that a file not recognized error occurred and there was no file in raspberrypi.
So raspberrypi installed wiringPi through the terminal.
So I installed wiringPi related files in raspberrypi's / usr / local / lib folder.I thought this was the cause of the error.
However, as you know, the error was not resolved and the question was raised
-
@this I know that you're cross compiling.
"However, I thought that a file not recognized error occurred and there was no file in raspberrypi." - for cross compilation it doesn't matter whether the lib is on RaspberryPi or not as you're building on your Ubuntu machine - you need it on your Ubuntu machine.
So, on your Ubuntu machine the lib is this: /usr/local/lib/libwiringPi.so (symbolic link) and /usr/local/lib/libwiringPi.so.2.44 (lib itself), right? -
This post is deleted!