Cross compiling for RPi - error while loading shared librariesMissing libcofi_rpi.so on host machineMongodb cross compilation on linux for Raspberry Pihow to install cross-compiled OpenCV's libraries on raspbery piCross Compiling Protobuf for Raspberry PiCross-Compiling kernel can't find gccEmbedded Xinu for RPiCross Compile Error Using arm-linux-gnueabihf-gccWhen I compile with arm-linux-gnueabihf-g++ version 4.7, I get error while loading shared libraries: libstdc++.so.6Is it possible to fix the “cannot find -lgcc” and “cannot find -lgcc_s” error messages when using arm-linux-gnueabihf-g++ as a linker?What's causing these crashes after cross-compiling?
What's the point of deactivating Num Lock on login screens?
Decision tree nodes overlapping with Tikz
Can I make popcorn with any corn?
Why doesn't a class having private constructor prevent inheriting from this class? How to control which classes can inherit from a certain base?
Codimension of non-flat locus
Has there ever been an airliner design involving reducing generator load by installing solar panels?
dbcc cleantable batch size explanation
How is it possible to have an ability score that is less than 3?
Do I have a twin with permutated remainders?
How is the claim "I am in New York only if I am in America" the same as "If I am in New York, then I am in America?
What does "Puller Prush Person" mean?
How to source a part of a file
Cross compiling for RPi - error while loading shared libraries
High voltage LED indicator 40-1000 VDC without additional power supply
What is a clear way to write a bar that has an extra beat?
Why is consensus so controversial in Britain?
Is it possible to do 50 km distance without any previous training?
Is it legal for company to use my work email to pretend I still work there?
How much of data wrangling is a data scientist's job?
Do infinite dimensional systems make sense?
Rock identification in KY
Is it unprofessional to ask if a job posting on GlassDoor is real?
How can I prevent hyper evolved versions of regular creatures from wiping out their cousins?
Can you really stack all of this on an Opportunity Attack?
Cross compiling for RPi - error while loading shared libraries
Missing libcofi_rpi.so on host machineMongodb cross compilation on linux for Raspberry Pihow to install cross-compiled OpenCV's libraries on raspbery piCross Compiling Protobuf for Raspberry PiCross-Compiling kernel can't find gccEmbedded Xinu for RPiCross Compile Error Using arm-linux-gnueabihf-gccWhen I compile with arm-linux-gnueabihf-g++ version 4.7, I get error while loading shared libraries: libstdc++.so.6Is it possible to fix the “cannot find -lgcc” and “cannot find -lgcc_s” error messages when using arm-linux-gnueabihf-g++ as a linker?What's causing these crashes after cross-compiling?
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I'm trying to compile a simple program (blinking.c) on my Ubuntu using the ARM cross compile toolchain (arm-linux-gnueabihf-gcc) and run it on my Raspberry Pi. The program is using the wiringPi shared library (wiringPi.so) located in ~/wiringPi/wiringPi on Ubuntu. The code follows:
#include "wiringPi.h"
int main (void)
wiringPiSetup();
pinMode(0, OUTPUT);
for (;;)
digitalWrite(0, HIGH);
delay(500);
digitalWrite(0, LOW);
delay(500);
return 0;
I used the command:
arm-linux-gnueabihf-gcc blinking.c -o blinking -L ~/wiringPi/wiringPi -lwiringPi -I ~/wiringPi/wiringPi
to compile and successfully get the object file, which I then transfer to Raspberry Pi.
However, when trying to run the program on Pi, I get the following error:
./blinking: error while loading shared libraries: libwiringPi.so: cannot open shared object file: No such file or directory
What am I missing?
c wiringpi cross-compilation shared-libraries
New contributor
add a comment |
I'm trying to compile a simple program (blinking.c) on my Ubuntu using the ARM cross compile toolchain (arm-linux-gnueabihf-gcc) and run it on my Raspberry Pi. The program is using the wiringPi shared library (wiringPi.so) located in ~/wiringPi/wiringPi on Ubuntu. The code follows:
#include "wiringPi.h"
int main (void)
wiringPiSetup();
pinMode(0, OUTPUT);
for (;;)
digitalWrite(0, HIGH);
delay(500);
digitalWrite(0, LOW);
delay(500);
return 0;
I used the command:
arm-linux-gnueabihf-gcc blinking.c -o blinking -L ~/wiringPi/wiringPi -lwiringPi -I ~/wiringPi/wiringPi
to compile and successfully get the object file, which I then transfer to Raspberry Pi.
However, when trying to run the program on Pi, I get the following error:
./blinking: error while loading shared libraries: libwiringPi.so: cannot open shared object file: No such file or directory
What am I missing?
c wiringpi cross-compilation shared-libraries
New contributor
It looks like it can't find the library on the Pi. Have you installed wiringPi on the Pi (it should be preinstalled in full Raspbian, but not in Raspbian Lite).
– joan
1 hour ago
@joan Haven't installed wiringPi on Raspberry (using Raspbian Lite). I thought the compiler links the shared libraries to the program object files. I guess I need to learn more about dynamic libraries. Just saw the answer by Ralf which explains it.
– A6SE
1 hour ago
add a comment |
I'm trying to compile a simple program (blinking.c) on my Ubuntu using the ARM cross compile toolchain (arm-linux-gnueabihf-gcc) and run it on my Raspberry Pi. The program is using the wiringPi shared library (wiringPi.so) located in ~/wiringPi/wiringPi on Ubuntu. The code follows:
#include "wiringPi.h"
int main (void)
wiringPiSetup();
pinMode(0, OUTPUT);
for (;;)
digitalWrite(0, HIGH);
delay(500);
digitalWrite(0, LOW);
delay(500);
return 0;
I used the command:
arm-linux-gnueabihf-gcc blinking.c -o blinking -L ~/wiringPi/wiringPi -lwiringPi -I ~/wiringPi/wiringPi
to compile and successfully get the object file, which I then transfer to Raspberry Pi.
However, when trying to run the program on Pi, I get the following error:
./blinking: error while loading shared libraries: libwiringPi.so: cannot open shared object file: No such file or directory
What am I missing?
c wiringpi cross-compilation shared-libraries
New contributor
I'm trying to compile a simple program (blinking.c) on my Ubuntu using the ARM cross compile toolchain (arm-linux-gnueabihf-gcc) and run it on my Raspberry Pi. The program is using the wiringPi shared library (wiringPi.so) located in ~/wiringPi/wiringPi on Ubuntu. The code follows:
#include "wiringPi.h"
int main (void)
wiringPiSetup();
pinMode(0, OUTPUT);
for (;;)
digitalWrite(0, HIGH);
delay(500);
digitalWrite(0, LOW);
delay(500);
return 0;
I used the command:
arm-linux-gnueabihf-gcc blinking.c -o blinking -L ~/wiringPi/wiringPi -lwiringPi -I ~/wiringPi/wiringPi
to compile and successfully get the object file, which I then transfer to Raspberry Pi.
However, when trying to run the program on Pi, I get the following error:
./blinking: error while loading shared libraries: libwiringPi.so: cannot open shared object file: No such file or directory
What am I missing?
c wiringpi cross-compilation shared-libraries
c wiringpi cross-compilation shared-libraries
New contributor
New contributor
New contributor
asked 1 hour ago
A6SEA6SE
1133
1133
New contributor
New contributor
It looks like it can't find the library on the Pi. Have you installed wiringPi on the Pi (it should be preinstalled in full Raspbian, but not in Raspbian Lite).
– joan
1 hour ago
@joan Haven't installed wiringPi on Raspberry (using Raspbian Lite). I thought the compiler links the shared libraries to the program object files. I guess I need to learn more about dynamic libraries. Just saw the answer by Ralf which explains it.
– A6SE
1 hour ago
add a comment |
It looks like it can't find the library on the Pi. Have you installed wiringPi on the Pi (it should be preinstalled in full Raspbian, but not in Raspbian Lite).
– joan
1 hour ago
@joan Haven't installed wiringPi on Raspberry (using Raspbian Lite). I thought the compiler links the shared libraries to the program object files. I guess I need to learn more about dynamic libraries. Just saw the answer by Ralf which explains it.
– A6SE
1 hour ago
It looks like it can't find the library on the Pi. Have you installed wiringPi on the Pi (it should be preinstalled in full Raspbian, but not in Raspbian Lite).
– joan
1 hour ago
It looks like it can't find the library on the Pi. Have you installed wiringPi on the Pi (it should be preinstalled in full Raspbian, but not in Raspbian Lite).
– joan
1 hour ago
@joan Haven't installed wiringPi on Raspberry (using Raspbian Lite). I thought the compiler links the shared libraries to the program object files. I guess I need to learn more about dynamic libraries. Just saw the answer by Ralf which explains it.
– A6SE
1 hour ago
@joan Haven't installed wiringPi on Raspberry (using Raspbian Lite). I thought the compiler links the shared libraries to the program object files. I guess I need to learn more about dynamic libraries. Just saw the answer by Ralf which explains it.
– A6SE
1 hour ago
add a comment |
1 Answer
1
active
oldest
votes
Shared or dynamic libraries are needed at run time. So you need the library not only on the build system but in on the target system, in this case on the PI.
This is different from static libraries. If you use a static library at build time, all the needed code from the library would be included in the executable, and the library would not be needed to run the program.
So you have to copy the library to the PI into a directory that is searched for shared libraries, such as /usr/lib
or /usr/local/lib
. You can also set LD_LIBRARY_PATH
to point to the library, but then you must make sure it is always set when you want to execute the program.
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
return StackExchange.using("schematics", function ()
StackExchange.schematics.init();
);
, "cicuitlab");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "447"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
A6SE is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fraspberrypi.stackexchange.com%2fquestions%2f96177%2fcross-compiling-for-rpi-error-while-loading-shared-libraries%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Shared or dynamic libraries are needed at run time. So you need the library not only on the build system but in on the target system, in this case on the PI.
This is different from static libraries. If you use a static library at build time, all the needed code from the library would be included in the executable, and the library would not be needed to run the program.
So you have to copy the library to the PI into a directory that is searched for shared libraries, such as /usr/lib
or /usr/local/lib
. You can also set LD_LIBRARY_PATH
to point to the library, but then you must make sure it is always set when you want to execute the program.
add a comment |
Shared or dynamic libraries are needed at run time. So you need the library not only on the build system but in on the target system, in this case on the PI.
This is different from static libraries. If you use a static library at build time, all the needed code from the library would be included in the executable, and the library would not be needed to run the program.
So you have to copy the library to the PI into a directory that is searched for shared libraries, such as /usr/lib
or /usr/local/lib
. You can also set LD_LIBRARY_PATH
to point to the library, but then you must make sure it is always set when you want to execute the program.
add a comment |
Shared or dynamic libraries are needed at run time. So you need the library not only on the build system but in on the target system, in this case on the PI.
This is different from static libraries. If you use a static library at build time, all the needed code from the library would be included in the executable, and the library would not be needed to run the program.
So you have to copy the library to the PI into a directory that is searched for shared libraries, such as /usr/lib
or /usr/local/lib
. You can also set LD_LIBRARY_PATH
to point to the library, but then you must make sure it is always set when you want to execute the program.
Shared or dynamic libraries are needed at run time. So you need the library not only on the build system but in on the target system, in this case on the PI.
This is different from static libraries. If you use a static library at build time, all the needed code from the library would be included in the executable, and the library would not be needed to run the program.
So you have to copy the library to the PI into a directory that is searched for shared libraries, such as /usr/lib
or /usr/local/lib
. You can also set LD_LIBRARY_PATH
to point to the library, but then you must make sure it is always set when you want to execute the program.
answered 1 hour ago
RalfFriedlRalfFriedl
6711210
6711210
add a comment |
add a comment |
A6SE is a new contributor. Be nice, and check out our Code of Conduct.
A6SE is a new contributor. Be nice, and check out our Code of Conduct.
A6SE is a new contributor. Be nice, and check out our Code of Conduct.
A6SE is a new contributor. Be nice, and check out our Code of Conduct.
Thanks for contributing an answer to Raspberry Pi Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fraspberrypi.stackexchange.com%2fquestions%2f96177%2fcross-compiling-for-rpi-error-while-loading-shared-libraries%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
It looks like it can't find the library on the Pi. Have you installed wiringPi on the Pi (it should be preinstalled in full Raspbian, but not in Raspbian Lite).
– joan
1 hour ago
@joan Haven't installed wiringPi on Raspberry (using Raspbian Lite). I thought the compiler links the shared libraries to the program object files. I guess I need to learn more about dynamic libraries. Just saw the answer by Ralf which explains it.
– A6SE
1 hour ago