Skip to content

wrzlbrmft/dynlib-c

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dynlib-c

An example showing how to load dynamic libraries at runtime using C.

This allows dynamic code execution, useful when adding module/plugin support to an app.

Build

Build using CMake >= 3.5 with

mkdir build
cd build
cmake -D CMAKE_BUILD_TYPE=Release ..
make

This builds a main executable dynlib as well as two example libraries: foo and bar.

Run

The main executable expects its first argument to be the library to load:

./dynlib ./libfoo.so

or

./dynlib ./libbar.so

NOTE: This is Linux; on other platforms the name of the libraries may vary.

License

This software is distributed under the terms of the GNU General Public License v3.

Releases

No releases published

Packages

No packages published