See Challenges of shared library environments, Part 2, why and when this is necessary to use.
This reimplements atexit
as it should be, just under a different name.
Release Version | Release Notes |
---|---|
RELEASENOTES |
You must statically link the mulle-atexit library with your executable. Ensure that global symbols are exported and that the whole library is linked to the executable and not optimized away by the linker.
Platform | Linker Flags |
---|---|
Linux | -Wl,--export-dynamic -Wl,--whole-archive |
macos | -force_load |
Use mulle-sde to add mulle-atexit to your project:
mulle-sde add github:mulle-core/mulle-atexit
To only add the sources of mulle-atexit with dependency sources use clib:
clib install --out src/mulle-core mulle-core/mulle-atexit
Add -isystem src/mulle-core
to your CFLAGS
and compile all the sources that were downloaded with your project.
Use mulle-sde to build and install mulle-atexit and all dependencies:
mulle-sde install --prefix /usr/local \
https://github.com/mulle-core/mulle-atexit/archive/latest.tar.gz
Install the requirements:
Requirements | Description |
---|---|
mulle-thread | 🔠Cross-platform thread/mutex/tss/atomic operations in C |
Download the latest tar or zip archive and unpack it.
Install mulle-atexit into /usr/local
with cmake:
cmake -B build \
-DCMAKE_INSTALL_PREFIX=/usr/local \
-DCMAKE_PREFIX_PATH=/usr/local \
-DCMAKE_BUILD_TYPE=Release &&
cmake --build build --config Release &&
cmake --install build --config Release
Nat! for Mulle kybernetiK