Shared libraries are libraries that are loaded by programs when they start. A single shared copy of each library is loaded into physical memory and may be used by multiple processes at the same time. This reduces memory use and improves system performance. This tag should never be used alone.
Questions tagged [shared-libraries]
7905 questions
75
votes
2 answers
How to specify non-default shared-library path in GCC Linux? Getting "error while loading shared libraries" when running
There is a laptop on which I have no root privilege.
onto the machine I have a library installed using configure --prefix=$HOME/.usr .
after that, I got these files in ~/.usr/lib :
libXX.so.16.0.0
libXX.so.16
libXX.so
libXX.la
libXX.a
when I…

Jokester
- 5,501
- 3
- 31
- 39
73
votes
9 answers
How to check what shared libraries are loaded at run time for a given process?
Is there a way to check which libraries is a running process using?
To be more specific, if a program loads some shared libraries using dlopen, then readelf or ldd is not going to show it.
Is it possible at all to get that information from a running…

BЈовић
- 62,405
- 41
- 173
- 273
73
votes
3 answers
What is armeabi and why they use it?
I see this library (armeabi) many times when I explore open sources.
I net searched for an explanation of it, but all the results I found are talking ABOUT it and not defining it.
What is this armeabi and why are they using it in Android…

Esmaeel ibrahim
- 723
- 1
- 5
- 5
73
votes
7 answers
How can I tell, with something like objdump, if an object file has been built with -fPIC?
How can I tell, with something like objdump, if an object file has been built with -fPIC?

Crazy Chenz
- 12,650
- 12
- 50
- 62
72
votes
1 answer
Why are LIB files beasts of such a duplicitous nature?
I'm trying to understand this LIB file business on Microsoft Windows, and I've just made a discovery that will - I hope - dispel the confusion that hitherto has prevented me from getting a clear grasp of the issue. To wit, LIB files are not the one…

Lumi
- 14,775
- 8
- 59
- 92
70
votes
5 answers
Convert a Static Library to a Shared Library?
I have a third-party library which consists mainly of a large number of static (.a) library files. I can compile this into a single .a library file, but I really need it to be a single .so shared library file.
Is there any way to convert a static…

Eli Courtwright
- 186,300
- 67
- 213
- 256
70
votes
5 answers
What is the 'soname' option for building shared libraries for?
I learned the "Program Library HOWTO". It mention that using soname to manage the version like follow.
gcc -shared -fPIC -Wl,-soname,libfoo.so.1 -o libfoo.so.1.0.0 foo.c
ln -s libfoo.so.1.0.0 libfoo.so.1
ln -s libfoo.so.1 libfoo.so
And I get the…

Samuel
- 5,977
- 14
- 55
- 77
69
votes
7 answers
ctypes error: libdc1394 error: Failed to initialize libdc1394
I'm trying to compile my program to a shared library that I can use from within Python code using ctypes.
The library compiles fine using this command:
g++ -shared -Wl,-soname,mylib -O3 -o mylib.so -fPIC [files] `pkg-config --libs --cflags…

fredley
- 32,953
- 42
- 145
- 236
68
votes
6 answers
Is /usr/local/lib searched for shared libraries?
Is /usr/local/lib searched for shared libraries ? I have this error:
[Leo@chessman ~]$ whereis ffmpeg
ffmpeg: /usr/local/bin/ffmpeg
[Leo@chessman ~]$ ffmpeg
ffmpeg: error while loading shared libraries: libavcore.so.0: cannot open shared object…

Leo Izen
- 4,165
- 7
- 37
- 56
68
votes
2 answers
Force GCC to notify about undefined references in shared libraries
I have a shared library that is linked with another (third-party) shared library. My shared library is then loaded using dlopen in my application. All this works fine (assuming files are in the proper path etc).
Now, the problem is that I don't even…

Fredrik Ullner
- 2,106
- 2
- 22
- 28
67
votes
3 answers
What is the difference between .o, .a, and .so files?
I know .o are object files, .a are static libraries and .so are dynamic libraries? What is their physical significance? When can I use some and when not?

Utkarsh Srivastav
- 3,105
- 7
- 34
- 53
67
votes
6 answers
CMake: how create a single shared library from all static libraries of subprojects?
I have the following layout:
top_project
+ subproject1
+ subproject2
Each of subproject1 and subproject2 creates a static library. I would like to link these static libraries in a single shared library at the top_project level.
The…

Deimos
- 1,835
- 1
- 16
- 15
65
votes
1 answer
What does "Ex" stand for in Windows API function names?
In windows APIs and various other libraries where I have seen multiple entry points to methods I have noticed the use of the Ex abbreviation in scenarios such as MyApiCall and MyApiCallEx.
My assumption is that this stands for Extension or Extra…

Maxim Gershkovich
- 45,951
- 44
- 147
- 243
64
votes
8 answers
How to list library dependencies of a non-native binary?
When developing for native platform, I can use ldd to list all the shared libraries (.so files) a binary executable I build will try to load upon start-up. But when cross-compiling, I don't know how to get the same information. The ldd is not a…

lvella
- 12,754
- 11
- 54
- 106
61
votes
6 answers
Determine target ISA extensions of binary file in Linux (library or executable)
We have an issue related to a Java application running under a (rather old) FC3 on an Advantech POS board with a Via C3 processor. The java application has several compiled shared libs that are accessed via JNI.
Via C3 processor is supposed to be…

Fernando Miguélez
- 11,196
- 6
- 36
- 54