This is an example regarding Opencv and C implementation. The main.cpp is contained inside the src folder. it is compiled while building the snap.
The Opencv library could be obtained from ubuntu store or it is possible to compile an arbitrary library version while building (this part is commented on the snapcraft.yaml)
launching the command below the app is being build for your PC architecture. amd64 on a common PC and arm64 in case we're using a raspberry PI or similar.
$ snapcraft
it is possible to build for different architectures using the remote-build option.
$ snapcraft remote-build --build-on=amd64,arm64
$ cmake .
$ make