Babeltrace 2 C API  2.0.0
Open-source trace manipulation framework
Compile and link a Babeltrace 2 shared object plugin

To compile and link a Babeltrace 2 shared object plugin:

  1. Compile the plugin's C/C++ source files with the -fPIC and -c compiler options to produce position-independent code and to compile without linking:

    $ cc my-plugin.c analysis.c -fPIC -c $(pkg-config --cflags babeltrace2)

  2. Link the resulting object files with the -shared linker option and with the Babeltrace 2 library:

    $ ld my-plugin.o analysis.o -o my-plugin.so -shared $(pkg-config --libs babeltrace2)
Note
At least one of your C/C++ files must declare a Babeltrace 2 plugin and one or more component classes using the Plugin development macros.