Libgstqml6.so fails to link to libQt6Core.so

Compiling gst-plugins-good version 1.22.6 successfully locates Qt 6.2.6 and installs libgstqml6.so. However, the plugin is blacklisted by default and running gst-inspect-1.0 gst_1.22.6/out/lib/aarch64-linux-gnu/gstreamer-1.0/libgstqml6.so gives me:

(gst-inspect-1.0:19968): GStreamer-WARNING **: 11:09:25.584: Failed to load plugin 'out/lib/aarch64-linux-gnu/gstreamer-1.0/libgstqml6.so': libQt6Core.so.6: cannot open shared object file: No such file or directory

The path to libQt6Core.so.6 is added to PATH as well as PKG_CONFIG_PATH pointing to Qt’s pkgconfig (compilation of GStreamer has no problem finding it after all).

My ultimate goal is to be able to use the qmlglsink which I expect is in this plugin (correct me if I’m wrong).

Do I need to link libgstqml6.so statically to Qt6 or is there something else I can do?

I had simply forgotten to add path to Qt6’s shared object files to LD_LIBRARY_PATH:

export LD_LIBRARY_PATH=/path/to/libQt6Core.so.6:$LD_LIBRARY_PATH