third-part libraries used in snap package

I link third part library in my sdk projrct, and configurate the path in CMakelist and Snapcraft.yaml file, after pack it to snap package and run it, it could not call the function in lib, and dispaly error in log:

What is the correct step to configure the use of third-party libraries in CMakeList and Snapcraft.yaml file?

Best reply by AkashD

Hey,

It seems your executable couldn't find the lib 'libMvCameraControl.so' . You can configure the PATH of your library in 'snapcraft.yaml' by creating a custom environment variable or use system env variable such as 'LD_LIBRARY_PATH' to dynamically link executables.

E.g.

...
apps:
  backend:
    command: boschRexroth
    # interfaces to connect to https://snapcraft.io/docs/supported-interfaces
    environment: 
      LD_LIBRARY_PATH: $LD_LIBRARY_PATH:/path/to/your/library.so
    plugs:
      - network
    daemon: simple
...

Β 

View original
2 replies