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
27
votes
2 answers
Can't load shared library libQt5Core.so.5
This question has been asked before, but the fixes don't work for me. I am running Windows 10 with WSL (Debian) and I am unable to run a QT program because of the error
texconv: error while loading shared libraries: libQt5Core.so.5: cannot open…

Protofall
- 612
- 1
- 6
- 15
27
votes
1 answer
How to make a header-only library with cmake?
How to make a project in cmake that collects all c++ files into one header?
I have this project structure.
/
project/
folder1/
file.cpp
file.hpp
folder2/
...etc
CMakeLists.txt
tests/
test.cpp
…

Wootiae
- 728
- 1
- 7
- 17
27
votes
2 answers
How to set RPATH and RUNPATH with GCC/LD?
I recently encountered this problem after an upgrade of the system: using the GCC -Wl,-rpath= option works differently than before.
I used it to set the search paths to some shared libraries that were built in a sub-module of my project. At the time…

Machta
- 1,656
- 2
- 16
- 28
27
votes
2 answers
Why is -L needed when -rpath is used?
I find that the -L flag must be given when using -rpath. For instance:
gcc -o test test.o -L. -lmylib -Wl,-rpath=.
Why is the -L flag needed? What information more than the information from the h-files are needed at compile time?
If I remove -L. I…

Fredrik Johansson
- 1,301
- 1
- 13
- 26
27
votes
1 answer
Can rust library be used from another languages in a way c libraries do?
Writing such library will I have to sacrifice std? How, for example, will do I write python bindings to rust library, if possible?

Moonwalker
- 2,180
- 1
- 29
- 48
27
votes
3 answers
Linking a shared library with another shared lib in linux
I am trying to build a shared library. Let us say libabc.so. It uses another .so file , say lib123.so (a lib in /usr/local/lib). Now I am using my shared lib libabc.so in my application. Say my-app. I want to know how I should link these binaries? I…

A R
- 2,697
- 3
- 21
- 38
27
votes
5 answers
OAuth 2.0 integration in iOS
I have been trying for ages now to get OAuth 2.0 integration in my iPhone application.
I have searched and searched for libraries, tutorials, etc... But they have all lead me to a dead end. The main problem I have is that they either have deprecated…

Supertecnoboff
- 6,406
- 11
- 57
- 98
27
votes
4 answers
How can a shared library (.so) call a function that is implemented in its loader code?
I have a shared library that I implemented and want the .so to call a function that's implemented in the main program which loads the library.
Let's say I have main.c (executable) which contains:
void inmain_function(void*);
dlopen("libmy.so");
In…

0x90
- 39,472
- 36
- 165
- 245
27
votes
2 answers
Does ldd also show dependencies of dependencies?
I have a binary for which ldd shows an unexpected dependency und libicuuc (from "icu").
#ldd A
[...]
libxml2.so.2 => /usr/lib64/libxml2.so.2 (0x00007faaf9722000)
libicuuc.so.49 => /usr/lib64/libicuuc.so.49 (0x00007faaf5689000)
Since on this system…

Thomas
- 2,093
- 3
- 23
- 28
26
votes
5 answers
TFS 2010 Branch Across Team Projects - Best Practices
I'm having issues understanding how to configure TFS according to best practices as provided by the TFS Ranger team. The issue is such:
My company has several products which make use of a shared common code base.
> $/Core
> -> /Main/Source (Parent…

Daniel
- 1,843
- 2
- 18
- 27
26
votes
5 answers
/usr/bin/ld: cannot find
I created a .so file and put it in the location /opt/lib and added this path to LD_LIBRARY_PATH now after this when I try to compile my main program with the following command:
g++ -Wall -I/home/alwin/Development/Calculator/ main.cpp -lcalc -o…

Alwin Doss
- 962
- 2
- 16
- 33
26
votes
5 answers
Understanding how dynamic linking works on UNIX
Consider we have the following situation:
a program named program which depends dynamically on libfoo.so
libfoo.so that depends on nothing (well, it depends on libstdc++ and stuff but I guess we can omit that)
program runs perfectly.
Suddenly,…

ereOn
- 53,676
- 39
- 161
- 238
26
votes
2 answers
Difference between using java.library.path and LD_LIBRARY_PATH
Is there a difference between setting the JVM argument
-Djava.library.path=/path
at JVM start and setting the Linux environment variable
export LD_LIBRARY_PATH=/path
before the JVM is started?
What are the advantages/disadvantages of the two…

christian
- 9,412
- 10
- 41
- 51
26
votes
4 answers
How can I change the filename of a shared library after building a program that depends on it?
I have a program that depends on a shared library it expects to find deep inside a directory structure. I'd like to move that shared library out and into a better place. On OS X, this can be done with install_name_tool. I'm unable to find an…

ZorbaTHut
- 1,163
- 1
- 11
- 19
26
votes
6 answers
Static analysis tool to detect ABI breaks in C++
It's not very hard to break binary backwards-compatibility of a DSO/shared library with a C++ interface. That said, is there a static analysis tool, which can help detecting such ABI breaks, if it's given two different sets of header files: those of…

okun
- 338
- 3
- 10