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
43
votes
5 answers
Creating a simple Makefile to build a shared library
I am trying to create a very basic hand crafted Makefile to create a shared library to illustrate a point.
This is what I have so far:
SHELL = /bin/sh
CC = gcc
FLAGS = -std=gnu99 -Iinclude
CFLAGS = -fPIC -pedantic -Wall -Wextra…

Homunculus Reticulli
- 65,167
- 81
- 216
- 341
43
votes
6 answers
Stripping linux shared libraries
We've recently been asked to ship a Linux version of one of our libraries, previously we've developed under Linux and shipped for Windows where deploying libraries is generally a lot easier. The problem we've hit upon is in stripping the exported…

Adam Bowen
- 10,820
- 6
- 36
- 41
42
votes
1 answer
nm symbol output t vs T in a shared so library
I have added a new function (fuse_lowlevel_notify_inval_directory) in user space fuse library.
The compilation and creation of libfuse.so is finished without error.
But when my application tries to use this new function, the linker is throwing…

ashish
- 813
- 3
- 10
- 18
41
votes
1 answer
cmake find_package specify path
I have 2 versions of OpenCV installed on my machine. One is in /usr/local/opencv3.1. I presume the install location of the other one (version 3.4) is /usr/local. Anyway, find_package(OpenCV 3.0 REQUIRED) sets OpenCV_DIR:PATH=/usr/local/share/OpenCV.…

Gerry
- 1,938
- 3
- 18
- 25
41
votes
1 answer
How to specify the library version to use at link time?
Following question How do applications resolve to different versions of shared libraries at run time?, I wondered how to specify on the link command line which version of the library to use?
Let's say I have
libmy.so.1.0
libmy.so.1 ->…

Didier Trosset
- 36,376
- 13
- 83
- 122
41
votes
4 answers
How do applications resolve to different versions of shared libraries at run time?
I'm a noob to how shared libraries work on linux. I am trying to understand how do applications resolve different revisions of the same shared library at run-time on linux.
As far as I understand, a shared library has three "names", for…

nisah
- 2,478
- 3
- 22
- 20
41
votes
1 answer
Easiest way to install Python dependencies on Spark executor nodes?
I understand that you can send individual files as dependencies with Python Spark programs. But what about full-fledged libraries (e.g. numpy)?
Does Spark have a way to use a provided package manager (e.g. pip) to install library dependencies? Or…

trianta2
- 3,952
- 5
- 36
- 52
41
votes
2 answers
Compile with older libc (version `GLIBC_2.14' not found)
I have to compile a program on a current ubuntu (12.04). This program should then run on a cluster using CentOS with an older Kernel (2.6.18). I cannot compile on the cluster directly, unfortunately. If I just compile and copy the program without…

Flogo
- 1,673
- 4
- 20
- 33
39
votes
2 answers
unused DT entry: type 0x1d arg
I am using android NDK-r10d to build Android x86 executable (shared linking) that runs on adb shell. On run time, I am getting the following warning:
WARNING: linker: ./myapp: **unused DT entry:** type 0x1d arg 0x4a604
I am using a rooted Nexus…

Sreenath P V
- 393
- 1
- 3
- 7
39
votes
2 answers
Relation between object file and shared object file
what is the relation between shared object(.so) file and object(.o) file?
can you please explain via example?

ASHOK
- 1,475
- 4
- 14
- 14
38
votes
1 answer
Nested structures in Ruby Fiddle
Is it somehow possible to define nested structure signatures in
Ruby's Fiddle lib?
Or at this point via any other up-to-date library which I'm not
familiar with?
It is kind of a desperate question since I've searched through the documentation and…

Ríša Werner
- 501
- 3
- 6
37
votes
5 answers
Linux capabilities (setcap) seems to disable LD_LIBRARY_PATH
I use LD_LIBRARY_PATH to set the path of a certain user library for an application. But if I set capabilities on this application
sudo setcap CAP_NET_BIND_SERVICE=eip myapplication
then LD_LIBRARY_PATH seems to be ignored. When I launch the…

Lorenzo Pistone
- 5,028
- 3
- 34
- 65
37
votes
2 answers
why do we need the shared library during compile time
Why we need the presence of the shared library during the compile time of my executable? My reasoning is that since shared library is not included into my executable and is loaded during the runtime, it is not supposed to be needed during compile…

Gab是好人
- 1,976
- 1
- 25
- 39
37
votes
7 answers
Share gitlab-ci.yml between projects
We are thinking to move our ci from jenkins to gitlab. We have several projects that have the same build workflow. Right now we use a shared library where the pipelines are defined and the jenkinsfile inside the project only calls a method defined…

pyriand3r
- 667
- 1
- 8
- 18
37
votes
3 answers
How do you tell Valgrind to completely suppress a particular .so file?
I'm trying to use Valgrind on a program that I'm working on, but Valgrind generates a bunch of errors for one of the libraries that I'm using. I'd like to be able to tell it to suppress all errors which involve that library. The closest rule that I…

Jonathan M Davis
- 37,181
- 17
- 72
- 102