Generics Reference Manual

Compiling your own libgenerics based on applications


    An important point concerns the metaclasses libgenerics stores for the related dynamically linked to binaries. The libgenerics metaclasses list references the whole declared metaclasses in the libgenerics itself, in the core application binary and in the core application potential modules. It is declared as a static variable automatically populated without any initialization requirement. All those metaclasses are accessible before the application main execution point is accessed. Because all of the principle of the libgenerics runtime analyse engine is performed on the metaclasses facilities, there must be only one metaclasses list defined in a whole application binary, including its potential dynamically linked modules.

    So, if the target application is developped to dynamically link some modules, it should be build as follow :
- the target application core binary must be build with the -rdynamic GNU gcc option and linked to the libgenerics library,
- the target application modules must be build with the -shared GNU gcc option without any explicit libgenerics direct link directive.

    With those compilation directives, the unresolved symbols of the target application modules will be linked into the application segment itself and the  libgenerics metaclasses description centralization will be ensured.

    A libgenerics-1.2.pc file comes along with the generics headers, so you can use the pkg-config utility to build your code on.