Snap fails to run with GLIBC error

The error means that the binary was built against a newer libstdc++ than is included in the base snap you’re targeting. Is the Snapcraft project for your snap public? If so, that might help in diagnosing the problem.

Hi jamesh,
no problem I could make it public. By now it is in devmode. It is meant to run in classic mode as it is a file manager (and as such needs proprer rights on the system).

Couldn’t upload to snap store (external symlinnk errors?!?) - you can find my try here:

i’m pretty sure james wanted to see your source tree, not a binary build … :wink:

Okay, I’ve changed this to my snapcraft.yaml in use. Sources are retrieved automatically from
They’re built with autotools.

well … i meant the source tree containing your snapcraft.yaml file :slight_smile:

push it somewhere to github or if you do not have a github account, use a to paste the snapcraft.yaml file and give us the link here …

Okay, here it comes:



    command: usr/local/bin/gnome-commander

start with changing this to:

    command: snap/command-chain/desktop-launch  usr/local/bin/gnome-commander

so the execution environment gets actually set up properly …

Not needed. The gnome-3-28 extension does this already.

that is not my experience …

looking closer at this snapcraft.yaml you are forcefully copying libc and libstdc++ files around from the build host, dont do hat (remove both, “override-prime” and “override-stage”) the libc must come from your base snap …

Okay, I can install and run it afterwards. However, I get a core dump with many errors. I’ve pasted the output here:

i’D start with dropping all the stage-packages (just comment out the whole block) …

then do a re-build, snapcraft will actually assemble the list of the actually required stage packages for you and print it at the end of the build process in a copy/paste-able format, only include that list, i think there is a lot of duplication in your snap (against what the gnome extension already provides at runtime)

EDIT: oh, and also drop the configflags: ["--prefix=/usr/local"] line thats just moving stuff in a place thats possibly not searched by default … snapcraft already sets a proper prefix for you at build time …

I’m copying just because of the libstdc++ error (GLIBCXX version). The source won’t compile with gcc8.4. I’m using gcc9.3, which works. The base snap installs an older version, which breaks starting the snap from the beginning.

well, that wont work … if you need something newer, you also need to use a newer base snap … mixing libc versions can not work …

using gcc9.x shouldnt block you from using the correct libc, your binary will be linked against whatever libc6-dev was at build time and that lib must come from the same version the base snap is from (for core18 this is 18.04 … for core20 it is 20.04)

So I’m fully stuck here. core18 doesn’t include a working version and core20 won’t let me include the “old” gtk2 dependancies.

of what exactly ?

This is somewhat strange. The GLIBCXX error doesn’t come up no more - version of libstdc++ is 6.0.25?!?

Okay, so I can agrre with you.

Okay, I’v done as you suggested, but the core dump shows up again (see above):

can you show your new snapcraft.yaml ?
(the code is still looking in the hosts /usr/local for things instead of $SNAP/usr or the /usr of the base snap)

1 Like