GenICam, or rather the GenAPI only handles the enumeration, unification (between different vendors), presentation of the camera features implementing GenICam.
GenTL on the other hand abstracts the transport interface and provides a standardized set of functions to the user.
So, if you want to work with camera features (GenAPI), you first need to work with a transport layer implementation to scan for cameras and communicate with them.
Being part of a standard means that the transport layer (GenTL) at least exposes the functions listed in GenTL.h
but usually a lot more. Moreover, GenTL providers are - as you correctly stated - usually shared libraries which are provided by the manufacturer, usually suffixed with .cti
.
Those can be dynamically loaded and the functions then used. Here is an example using a Basler GenTL provider:
#include <GenTL.h>
#include <dlfcn.h>
#include <dirent.h>
int main(){
// Load DLL at runtime
void *lib = dlopen("/opt/pylon/lib/pylonCXP/bin/ProducerCXP.cti", RTLD_NOW | RTLD_DEEPBIND);
// Declare variables with variable definitions from GenTL.h
GenTL::PGCInitLib GCInitLib;
GenTL::PGCCloseLib GCCloseLib;
// Dynamically bind GenTL functions to local function calls
*reinterpret_cast<void**>(&GCInitLib) = dlsym(lib, "GCInitLib");
*reinterpret_cast<void**>(&GCCloseLib) = dlsym(lib, "GCCloseLib");
GCInitLib(); // Init GenTL provider
// [Discover cameras, open port, load GenICam, do things]
GCCloseLib();
}
This can then be compiled with
g++ -l ldl main.cpp -o TestGenTL