Packaging an app that needs modern Qt versions

Hi, I’ve been trying to package an app I’m developing but I have had very little luck in getting it to work.

My app uses Qt, so from what I understand I need to use the kde-neon extension to get it to run from a snap.

I need modern versions of Qt and build tools, core18 is too old and core20 isn’t supported by kde-neon
so what I did was build on core18 using various sources to install my dependencies (in particular Qt is installed from a ppa).

I’m copying the Qt install into the prime directory (the ppa installs qt under /opt so I’m copying them to /prime/opt in the snap).

While the snap builds and install correctly, I get the error version 'Qt_5.14' not found when trying to launch my program from a snap install.

I guess it’s pulling libraries from whatever kde-neon is doing.
I was wondering if anyone knew what I’m supposed to do in this case, I haven’t managed to get the snap to work so far

make sure that $SNAP/opt is in your LD_LIBRARY_PATH environment variable when the app runs …

hmm, I’ve added

environment:
        LD_LIBRARY_PATH: "$LD_LIBRARY_PATH;$SNAP/opt"

to the app but it’s still trying to load from x1/kf5/usr/lib/x86_64-linux-gnu/libQt5Core.so.5

you want a colon, not a semicolon … and try putting $SNAP/opt to the front so it gets searched first …

… also, does $SNAP/opt/libQt5Core.so.5 exist ? or does it live in a subdir under opt/ … indeed you’d want that in your library path and not just $SNAP/opt …

1 Like

That worked, thanks.