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
7
votes
2 answers

How Do I Create a Development Framework In iOS Including Swift?

My goal in this was to create an iOS framework that incorporates both Swift and Objective-C that I could use in my development projects. The nature of this framework is that the framework itself is undergoing development. So, it was important that…
Chris Prince
  • 7,288
  • 2
  • 48
  • 66
7
votes
2 answers

How to compile ELF binary so that it can be loaded as dynamic library?

This is theoretical question. I am aware that perhaps best practice would be the use of shared libraries. But I ran into this question and cannot seem to find an answer anywhere. How to construct the code and compile in ELF format a program in C/C++…
Alexey Kamenskiy
  • 2,888
  • 5
  • 36
  • 56
7
votes
2 answers

C++ linux: dlopen can't find .so library

Reworded Question (although it's been solved already): I've been having trouble using dlopen(3) to load a shared object library on linux. The library is part of a system of libraries built by me that are all loaded at runtime by a central…
NmdMystery
  • 2,778
  • 3
  • 32
  • 60
7
votes
2 answers

Setting LD_LIBRARY_PATH environment variable for loading a shared library at runtime (g++)

I'm having two problems related to the same issue: I have a shared object saved in `pwd`/lib and while the executable that uses it compiles successfully (by using -l and -L switches), at runtime, it's giving me grief. If I try to run…
rhobincu
  • 906
  • 1
  • 7
  • 22
7
votes
3 answers

C++: Implement custom Main function

WinMain is a function that 'replaces' the default main entry point 'main'. The user can then define its main entry point like int WINAPI WinMain(...) { } How is this kind of encapsulation done? Well, most likely, at some point it looks like…
bytecode77
  • 14,163
  • 30
  • 110
  • 141
6
votes
2 answers

Is it safe to pass a uint64_t containing a 32-bit value to an external function whose parameter is actually a uint32_t?

I'm working on a cross-platform program that calls a function from a dynamic library with C linkage. I need to support multiple versions of this dynamic library, but between two of the versions I need to support, there is a function parameter that…
Bri Bri
  • 2,169
  • 3
  • 19
  • 44
6
votes
2 answers

What is the difference between shared and dynamic libraries in C?

I don't understand the difference between the two types of libraries, and many websites say that they are the same thing, but at school we use two different commands to create them dynamic library $ gcc -shared -o libsample.so lib.c $ gcc -o main…
luca vent
  • 61
  • 1
  • 3
6
votes
2 answers

LD_LIBRARY_PATH precedence

I've just stumbled on some weird behavior: before I launch my application I've set the LD_LIBRARY_PATH to some local lib directory which contains all needed libs. After launch I have part(the most part) libs are loaded from the LD_LIBRARY_PATH but a…
ixSci
  • 13,100
  • 5
  • 45
  • 79
6
votes
2 answers

framework in ios contain static or dynamic library inside

I have come across multiple sites describing that frameworks can contain both static as well as dynamic library. But how do I identify if what the framework actually contains is a dynamic library or a static library. I thought of first taking help…
Nav
  • 10,304
  • 20
  • 56
  • 83
6
votes
3 answers

Plugin architecture in C using libdl

I've been toying around, writing a small IRC framework in C that I'm now going to expand with some core functionality - but beyond that, I'd like it to be extensible with plugins! Up until now, whenever I wrote something IRC related (and I wrote a…
LukeN
  • 5,590
  • 1
  • 25
  • 33
6
votes
1 answer

Runtime library vs. dynamic library

I've been searching and reading for a while, but still cannot get clean answers: What's the difference between runtime library and dynamic library? To be specific, I want to know the following aspects: How does runtime library work in the building…
dazzphot
  • 307
  • 1
  • 3
  • 11
6
votes
3 answers

PHP unable to load dynamic library "php_pdo_oci.dll"

I'm running Apache 2.4.7 with PHP 5.5.9 on Windows 8. I installed PHPUnit and this warning image "warning" started to pop up. Yes I enabled extension loading in php.ini as well as "extension_dir" to correct folder and there is file named…
birokrats
  • 63
  • 1
  • 1
  • 3
6
votes
2 answers

Multiplatform way to determine if a dynamic library is present

I need to check if a dynamic library is present, so that later I can safely call functions that use this library. Is there a multiplatform way to check this? I am targeting MS Windows 7 (VC++11) and Linux (g++).
Parobay
  • 2,549
  • 3
  • 24
  • 36
6
votes
1 answer

OS X: convert .dylib to .a/.o (dynamic to static)?

Suppose I've read this caveat, and I still want to use TBB as a statically-linked library. (Pretend I'm working in an environment where users aren't allowed to create their own dylibs.) But I don't really want to rewrite the TBB makefile to generate…
Quuxplusone
  • 23,928
  • 8
  • 94
  • 159
6
votes
3 answers

Is it safe to call dlclose(NULL)?

I experience a crash when I pass a null pointer to dlclose. Should I check for null before calling dlclose? POSIX tells nothing about this: http://pubs.opengroup.org/onlinepubs/7908799/xsh/dlclose.html Is it undefined behaviour or a bug in dlclose…
Vanuan
  • 31,770
  • 10
  • 98
  • 102