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
2
votes
1 answer

Removing source code directory after compiling libraries

I have downloaded the source code from git for some third-party libraries, which contains a makefile, and so I have run make to compile the libraries. During compilation, this seems to add various libraries to directories such as /usr/bin. My…
Karnivaurus
  • 22,823
  • 57
  • 147
  • 247
2
votes
1 answer

iOS - How to use existing dynamic library (.so file)

I have an existing dynamic library, and I try to use this library into my iOS app using dlopen(), but the function always return NULL. The library is a .so file and comes from an Android project. dlerror() return…
Christophe Gigax
  • 3,211
  • 4
  • 25
  • 37
2
votes
1 answer

unresolved symbol __real_malloc while dynamically loading a library which is compiled with --wrap=malloc

As mentioned in other SO answers I am using the wrapping mechanism of GNU ld to intercept calls to malloc on Linux (see here for an example). The used linker flag is -Wl,--wrap=malloc and the respective void __wrap_malloc(size_t) is also…
MKroehnert
  • 3,637
  • 2
  • 34
  • 43
2
votes
2 answers

Creating shared library through g++ how to

Where is the official "how to" about creating and understanding technics used in dynamic library. I'm using g++ compiler. I've googled this question but I can't find anything official about this.
user2889159
2
votes
1 answer

How to pass arguments to a method loaded from a static library in CPP

I'm trying to write a program to use a static library of a C++ code into another C++ code. The first C++ code is hello.cpp: #include #include using namespace std; extern "C" void say_hello(const char* name) { cout << "Hello…
Zeinab Abbasimazar
  • 9,835
  • 23
  • 82
  • 131
2
votes
1 answer

error at dlsym(): ./dynlibrary: undefined symbol: method

I've got an issue I am not able to solve. Looked up everything I found so far. My problem is, I create a dyn library in my program a want to dlopen it and dlsym a method out of that lib. It seems that dlopen works but dlsym return me the error…
LongRon
  • 73
  • 1
  • 9
2
votes
1 answer

skipping incompatible lib_share.so when searching for -lMY_LIB cannot find -lMY_LIB

I am trying to build lib_share.so file from exiting MY_LIB.so file. MY_LIB.so file is in my_path. g++ -shared -o lib_share.so -L/my_path -lMYLIB When I run ,it is giving me error as fallows bin/ld: skipping incompatible /home/folder/lMY_LIB.so…
2
votes
1 answer

Relocations R_386_JUMP_SLOT of local symbols in shared object

I'm digging in dynamic relocation process and i created a very simple shared object: int func_1(int v) { v + 10; } int func_2() { return func_1(10); } compiled as: gcc -fPIC -c libtest.c gcc -shared -nostdlib -o libtest.so libtest.o If we…
MirkoBanchi
  • 2,173
  • 5
  • 35
  • 52
2
votes
1 answer

Detection of framework usage on Mac system?

I wanted to develop sample framework on OSX with having requirement that at any point in time the framework should be used by only single client, i am not getting how to achieve this ? is their any API's to detect weather the framework is in use?…
2
votes
2 answers

detect iOS dylib (jailbreak)

Is there an elegant way (Objective C or C) for my app (jailbroken iOS) to check whether a specific dynamic library is available or not in iOS, other than checking if the actual dylib file exists at a specific path with an NSFileManager or calling…
newenglander
  • 2,019
  • 24
  • 55
2
votes
1 answer

Dynamically linking to a shared Java Library in Android

I'm trying to separate a Java Library, that is used by multiple Android "services", into a dynamic or shared library that can be loaded by those independent services without having the library included into the APK of each service. I know there are…
HerpDerp
  • 53
  • 1
  • 8
2
votes
1 answer

How to link a LKM (loadable kernel module) to static or dynamic libraries?

After searching I couldn't find any example that a LKM uses a static or dynamic libraries. I want to create static and dynamic libraries (may be use standard C library or any other libraries), then develop a LKM that uses my own static and dynamic…
Amir Saniyan
  • 13,014
  • 20
  • 92
  • 137
2
votes
2 answers

Can I prohibit certain functions from crashing a program?

I wish to make interactive code learning system, it allows users, (young programmers normally) to write contents of one function in c++ language, send it to server and there it will be compiled into dynamic library and called from main…
user1308345
  • 1,032
  • 1
  • 8
  • 14
1
vote
1 answer

More info on functions like __dyld__dyld_start on MacOS

On MacOS I'm seeing a stack that looks like so (at the very top of the stack is a trap the code in question, but I want to understand how I get there) (gdb) where ... #4 0x0000000112fdefc8 in appLibInit::appLibInit () #5 0x0000000112fdef71 in…
Peeter Joot
  • 7,848
  • 7
  • 48
  • 82
1
vote
2 answers

Dynamically load jar depending on OS

I'm trying to find a way to dynamically load a platform dependent library jar for the current OS. I need to access a third party library that uses JNI calls, and has different jars for Mac and Windows. All of the calls and returns for the two…
IgnisFatuus
  • 1,998
  • 1
  • 12
  • 8