Trying to use kde-neon-6 for a Qt app with Qt multimedia, OpenGL, more

I have a Qt 6 application. Amongst others, it also uses Qt multimedia (for audio output).

I’ve tried to keep things simple and rely upon the kde-neon-6 extension in order to incorporate Qt. But it seems that doesn’t necessarily imply many of the extension libraries, and there’s no other easy way to include them.

If I declare only:

base: core22

...

  extensions:
    - kde-neon-6

… and nothing else specific in build-packages or stage-packages then my snap builds. If I run objdump -T on the resulting binary then I see, amongst other things:

0000000000000000      DO *UND*	0000000000000000 (Qt_6.8)     qt_version_tag

Clearly that’s the version of Qt being implied by kde-neon-6. But trying to run the snap gives:

/snap/[X]/x19/usr/local/bin/[X]: error while loading shared libraries: libQt6OpenGLWidgets.so.6: cannot open shared object file: No such file or directory

And if I hence throw a quick ldd at it then the full list of ‘not found’ dependencies is:

	libQt6OpenGLWidgets.so.6 => not found
	libQt6Multimedia.so.6 => not found
	libQt6Widgets.so.6 => not found
	libQt6Gui.so.6 => not found
	libQt6Core.so.6 => not found

If I just add those additional packages to my snap, e.g.

    stage-packages:
      - libqt6core6
      - libqt6gui6
      - libqt6widgets6
      - libqt6openglwidgets6
      - libqt6multimedia6

… then that’s where the qt_version_tag becomes problematic. All of those packages are of Qt version 6.2. So now when I attempt to launch my snap I proceed only as far as:

/snap/[x]/x20/usr/local/bin/[x]: /snap/[x]/x20/usr/lib/aarch64-linux-gnu/libQt6Core.so.6: version `Qt_6.8' not found (required by /snap/[x]/x20/usr/local/bin/[x])

Or similar for whatever subset of the additional Qt libraries I stage with.

I’m not confident enough to say that my manner of investigation or my diagnosis is correct, but as above it seems like kde-neon-6 includes Qt 6.8 but not the OpenGL widgets, amongst others. Furthermore those don’t currently seem to be packaged for immediate use as a dependency, as the apt versions are still only of Qt 6.2.

So I think I’ve hit a wall. Am I right?

Which app is your snapcraft.yaml for?

Regarding QT dependencies, you can try using packages from the KDE Neon repository, but I also recommend replacing core22 with core24.

To try using KDE Neon packages with core24, add this to your snapcraft.yaml:

package-repositories:
  - type: apt
    url: http://origin.archive.neon.kde.org/user
    suites: [noble]
    components: [main]
    architectures: [amd64, arm64]
    key-id: 444DABCF3667D0283F894EDDE6D4736255751E5D

It’s just for an obscure emulator that I’m the author of; I keep the snapcraft.yaml separately so that’s here, as currently butchered. You’ll see from the revision history that I have been doing a bit of hit and hope on that. The actual application it relates to is here.

There was a much older version of the Snap that included huge chunks of Qt 5 but I’ve moved to Qt 6 in the interim and in any case wanted to do a better job.

I’ve so far avoided core24 because snapcraft try still isn’t implemented*, so the full feedback loop seems to be: (i) modify snapcraft.yaml; (ii) request a build; (iii) wait an hour-ish that to complete**; (iv) update local installation, get latest error, repeat. Whereas a purely-local snapcraft try && snap try && snap run is a much shorter and less noisy process.

It does look like qt6multimedia6, still the one I’m treating as the bellwether, is hosted by KDE at version 6.10 per manual browsing so I’ll definitely give that a go when I’m no longer at work.

* as confirmed in the official documentation as recently as last month.

** not an exaggeration, though possibly I’m quite fairly being rate limited. Build times when I last tried via snapcraft.io, yesterday, were ~56 minutes for arm64, ~65 minutes for amd64. It’s maybe three minutes locally.

I made a pull request to the Snap version repository, I managed to build and open it, but I have no idea how to test it.

If you managed to open it then you’re already leagues ahead of me; I didn’t manage to get past versioning errors as above. Thanks so much for the PR! I’ll give it a spin.

Late edit: yeah, it works perfectly. Thanks again! Re: “no idea how to test it”, I’m definitely aware that there are further issues with it at present but my failure at appropriate Snap integration was top of the list and I don’t think anything else is Snapcraft-related. So, again, thanks!