Ubuntu 22 switched the linker default to the setting where it discard seemingly “unused” library. By adding usage of " those useless classes" you work around this setting.
You can also use -Wl,--no-as-needed
to avoid the linker from dropping libraries that are not directly used.
2 Likes