Questions tagged [dynamic-library]

Compiled binaries capable to be loaded in the process address space in runtime.

Dynamic Libraries are compiled binaries capable of being loaded/unloaded into/from the process address space at runtime.

In the Unix world, they are called shared libraies; in the Windows world, they are known as DLLs (dynamically-loadable libraries).

They can be loaded simultaneously into multiple processes, saving RAM and disk space.

Their file format is similar to, or even the same as, that of binary executables.

484 questions
3
votes
1 answer

How to call a class and its function present in so file from a C++ program in Linux

Possible Duplicate: C++ Dynamic Shared Library on Linux I am writing a shared object say libtest.so which has a class and a function. I have another program say "Program.cpp" from which i want to call the class and its function present in the…
3
votes
2 answers

Shared library _sqlite3.so not found when importing sqlite3 on Python 2.6.6

Okay i've been battling for this for 2 days, that usually means its something too simple to realize. I have an embedded linux system which I cross compile on my ubuntu. When compiling python, sqlite3 is not on the list of modules that have not been…
Gjordis
  • 2,540
  • 1
  • 22
  • 32
2
votes
1 answer

How to compile a c++ program into shared library, and load it from a c program?

I am using gnu c compiler on centos 6, and the c program loads the shared library in the code dynamically.
Mickey Shine
  • 12,187
  • 25
  • 96
  • 148
2
votes
1 answer

C++ Qt: Static builds and external dylibs

I've been doing some funny stuff in personal projects with Qt. I'm not an expert in this so if it's a dumb question (guess not I couldn't find anything useful) feel free to kill me. Anyway, I'm in OSX and usually I compile the final versions…
TCB13
  • 3,067
  • 2
  • 39
  • 68
2
votes
1 answer

Creating and using dynamic libraries in OS X

We have a Windows application written in C++, part of which we are trying to port to Mac OS X. Our goal is to wrap the business logic into some libraries and build a Cocoa layer on top for the controller and the GUI. We will probably have several…
pajevic
  • 4,607
  • 4
  • 39
  • 73
2
votes
1 answer

C++ Dependency injection with Dynamic library loading

I am unable to use C++ dependency injection library "boost::di" with another boost library for dynamic loading of libraries named "Boost.dll". I broke down the problem into two parts - firstly, Testing dynamic loading, and secondly, binding the…
2
votes
1 answer

Thick binding dynamic library: Undefined references

What I did so far on my Linux Mint system: Write a thin binding to the GSL library Write a thick binding based on the thin binding Write a test program for 1. Write a test program for 2. When I create static libraries, everything works fine. When…
hreba
  • 107
  • 1
  • 8
2
votes
1 answer

Lifecycle of a shared library?

I've found multiple posts describing in detail the differences between static and shared libraries; however, I have yet to see an overarching view on when the shared library is loaded, what goes on here, and when the library is unloaded. Especially…
2
votes
2 answers

Not able to use function from my dynamic library loaded via LD_PRELOAD

I am trying to use sscanf() from preload.so which is generated from preload.c. To check my sscanf() from preload.so is called, I added extra print statement: printf("test\n"); Is there something I am missing? Files content mentioned…
Ami
  • 233
  • 2
  • 9
2
votes
2 answers

How to set CMAKE_INSTALL_RPATH with multiple directories?

On the question CMAKE RPATH not working - could not find shared object file I see how to set CMAKE_INSTALL_RPATH for a single path, but I need it for multiple paths. I tried these using but I did not worked: SET( CMAKE_INSTALL_RPATH…
Evandro Coan
  • 8,560
  • 11
  • 83
  • 144
2
votes
2 answers

When to use dynamic linking library in iOS ? And what is advantage of using dynamic library in iOS?

I feel weird about difference between advantage of dynamic linking library in Window or Linux and iOS. ⬇️ sentences below are to prove why I feel weird. I learned that library can divided into static library and dynamic library Advantage of using…
HyunSu
  • 155
  • 7
2
votes
0 answers

MSBuild does not match Visual Studio when referencing an indirectly referenced DLL

I apologize for asking this question, but I'm pretty sure the answer is "MSBuild is dumb, VS is smart". An indirectly referenced DLL is a DLL that is referenced from a directly referenced DLL but not referenced in the project at all. I have project…
BradLaney
  • 2,384
  • 1
  • 19
  • 28
2
votes
1 answer

Missing dependencies but application still runs on Mac M1

I'm using a Mac M1 with arm64 chip and I have an executable that depends on different .dylibs located in /usr/lib. These are: libc++.1.dylib, libSystem.b.dylib and libobjc.A.dylib. I got these results by doing otool -L myExecutable. Since I'm trying…
2
votes
1 answer

Check library built flags or options (-frecord-gcc-switches)

I'd like to check the library under investigation what flags and options were built with? I'm trying to use gcc compiler with option -frecord-gcc-switches to understand on my simple shared library but with no luck. The following is the piece of…
user3428154
  • 1,174
  • 5
  • 18
  • 38
2
votes
0 answers

Undefined symbol: fstat in dynamic library

I'm writing a dynamic library that's loaded at runtime as a plugin. At runtime, the library fails to load with the following message: dlerror:/path/to/so: undefined symbol: fstat The dynamic library consists of a bunch of static libraries linked…
leecbaker
  • 3,611
  • 2
  • 35
  • 51