Questions tagged [dynamic-linking]
Dynamic linking is a system which allows libraries to remain separate from programs until loaded, contrast static linking.
dynamic-linking
1,630
questions
0
votes
0
answers
17
views
How does the dynamic linker resolve symbols at run time?
I'm trying to understand how the dynamic linker resolves symbols at run time. I read chunks (but not all) of David Beazley et. al's The Inside Story on Shared Libraries and Dynamic Loading, but I don'...
1
vote
1
answer
37
views
When is late enough to use dlsym to find functions in another shared library?
Say I have an application foo that is linked against bar.so. I have another library, buzz.so that the application does not directly link, but that I use when I run the application with LD_PRELOAD like ...
1
vote
1
answer
30
views
Why is linking a dynamic library against a static library apparently easy on Windows but on Linux `-fPIC` makes that difficult? [closed]
I am working on adapting an existing ODBC driver so that it can target Linux.
ODBC Drivers are generally distributed as DLLs on Windows and shared objects (.so) on Linux.
The driver depends on Boost. ...
0
votes
0
answers
48
views
How to link with a custom dynamic (.so) library with Rust? [duplicate]
I have Rust code which is supposed to link with a dynamic library which is located in /path/to/library/build. I'm making Rust bindings/wrapper for another library written in C.
In build.rs:
println!(&...
1
vote
1
answer
44
views
How can I change the name of prebuilt shared library so that the executables can link with the new name?
I have prebuilt shared library (libssl.so) and I need to rename to a different name before linking to my executable(wpa_supplicant).
Reason: I don't want other executables from loading this library (...
0
votes
1
answer
67
views
attempting to link libc statically with clang, ldd showing dynamic linking?
I'd like to compile a C program with system libraries (such as libc) linked statically, with all my other custom libraries (such as openssl) linked dynamically. When I compile a "Hello World"...
0
votes
0
answers
75
views
rust program cannot find .so library on the path where it is
I am using rustgpu to compile shaders at runtime, meaning I have linked directly against spir-builder rather than using it in a build.rs.
I am getting this error:
error: failed to run `rustc` to learn ...
-1
votes
1
answer
158
views
dynamic linker in mac is not reading rpath
I am compiling a simple C program on m2 mac that depends on a shared library using clang on macOS. I am setting the rpath correctly using the -Wl,-rpath,@executable_path/../saga flag. I've verified ...
1
vote
1
answer
183
views
Symbol lookup error with Intel MKL on WSL
I have a C++ project and built it with CMake. I have no problem on Windows. However when I tried it on WSL I got symbol lookup error: /opt/intel/oneapi/mkl/latest/lib/libmkl_intel_thread.so.2: ...
0
votes
1
answer
178
views
Making binary depend on the correct `libpthread` [duplicate]
I have these files:
└─$ ls
ld-2.31.so libc.so.6 libpthread-2.31.so professor professor.zip
(I extracted them our of the zip file)
When running professor, I receive the following error:
└─$ ./...
0
votes
1
answer
53
views
Unable to load library from custom paths during compilation
I am working on cross compiling my code base for QNX aarch64 architecture on x86_64 host.
The gcc version i am using is 12.2 where it expects minimum glib version as 2.25 as per error :-
lib/gcc/...
0
votes
0
answers
51
views
Segmentation fault while loading library with LD_LIBRARY_PATH [duplicate]
i am facing GLIBC compatibility issues with newer version gcc 12.2
Log:-
/home/linux/x86_64/usr/lib/gcc/aarch64-unknown-nto-qnx8.0.0/12.2.0/cc1: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.25' ...
0
votes
0
answers
32
views
Is mixing dynamic and shared libraries a good idea when creating an ODBC Driver?
I am creating an ODBC driver (which is, by nature, distributed as a shared library) and don't want the users to have to find and install all of the dependencies.
Looking at how I might statically link ...
-1
votes
1
answer
134
views
Executable searching for the linked library in different path than the one set using LD_LIBRARY_PATH
I am building a C++ application using CMake. This application is supposedly to be run on VxWorks OS. This application needs a shared library which is built externally and imported to the project.
I ...
18
votes
1
answer
2k
views
Where is the order in which ELF relocations are applied specified?
Consider the following two files on a Linux system:
use_message.cpp
#include <iostream>
extern const char* message;
void print_message();
int main() {
std::cout << message << '\...