# Adding Third Party Libraries

**URL:** <https://forum.legato.io/t/adding-third-party-libraries/4755>\
**Category:** Uncategorized\
**Created:** [October 8, 2019, 3:04pm UTC](https://forum.legato.io/t/adding-third-party-libraries/4755 "2019-10-08T15:04:43Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jjjauterion](https://avatars.discourse-cdn.com/v4/letter/j/8e8cbc/32.png) [@jjjauterion](https://forum.legato.io/u/jjjauterion)\
**Post date:** [October 8, 2019, 3:04pm UTC](https://forum.legato.io/t/adding-third-party-libraries/4755/1 "2019-10-08T15:04:43Z")

</div>

Hello,

I am trying to port a legacy execuytable to the legato sandbox using these directions:

[https://docs.legato.io/15\_10/how\_to\_port\_legacy\_gen.html](https://docs.legato.io/15_10/how_to_port_legacy_gen.html)

It seems to create the bundle with all the nessecary libraries but when the app starts in the legato environment it throws an error and says it can’t find the required libraries. Here is my adef file:

// Disable the sandbox security to make things a little easier.  
sandboxed: false  
// Put the cross-compiled legacy program in the app’s bin directory.  
// = make it executable.  
bundles:  
{  
file:  
{  
 usr/bin/my\_app /bin/

```
[r] thirdparty/usr/lib/libcares.so.2.2.0	/usr/lib/
[r] thirdparty/usr/lib/libunwind-coredump.so.0.0.0 /usr/lib/
[r] thirdparty/usr/lib/libunwind-arm.so.8.0.1 /usr/lib/
[r] thirdparty/usr/lib/libgflags.so.2.2.0 /usr/lib/
[r] thirdparty/usr/lib/libgflags_nothreads.so.2.2.0 /usr/lib/
[r] thirdparty/usr/lib/libunwind-setjmp.so.0.0.0 /usr/lib/
[r] thirdparty/usr/lib/libglog.so.0 /usr/lib/
[r] thirdparty/usr/lib/libprotobuf-lite.so.15.0.1 /usr/lib/
[r] thirdparty/usr/lib/libprotoc.so.15.0.1 /usr/lib/
[r] thirdparty/usr/lib/libsqlite3.so.0.8.6 /usr/lib/
[r] thirdparty/usr/lib/libsqlite.so.0.8.6 /usr/lib/
[r] thirdparty/usr/lib/libunwind.so.8.0.1 /usr/lib/
[r] thirdparty/usr/lib/libunwind-ptrace.so.0.0.0 /usr/lib/
[r] thirdparty/usr/lib/libprotobuf.so.15.0.1 /usr/lib/
}

```

}

// Tell the Supervisor to start this program when the application is started.  
processes:  
{  
run:  
{  
(my\_app)  
}  
}

here is my build directory layout:

```
$ tree
.
└── wp76
    ├── app
    │ └── my_app
    │ ├── my_app.wp76
    │ └── staging
    │ ├── info.properties
    │ ├── read-only
    │ │ ├── bin
    │ │ │ └── my_app
    │ │ └── usr
    │ │ └── lib
    │ │ ├── libcares.so.2.2.0
    │ │ ├── libgflags_nothreads.so.2.2.0
    │ │ ├── libgflags.so.2.2.0
    │ │ ├── libglog.so.0
    │ │ ├── libprotobuf-lite.so.15.0.1
    │ │ ├── libprotobuf.so.15.0.1
    │ │ ├── libprotoc.so.15.0.1
    │ │ ├── libsqlite3.so.0.8.6
    │ │ ├── libsqlite.so.0.8.6
    │ │ ├── libunwind-arm.so.8.0.1
    │ │ ├── libunwind-coredump.so.0.0.0
    │ │ ├── libunwind-ptrace.so.0.0.0
    │ │ ├── libunwind-setjmp.so.0.0.0
    │ │ └── libunwind.so.8.0.1
    │ └── root.cfg
    ├── build.ninja
    ├── mktool_args
    └── mktool_environment

```

Uploading goes okay but I get the following error on from the sandbox:  
Oct 8 14:46:47 swi-mdm9x28-wp user.info Legato: INFO | supervisor[843]/supervisor T=main | app.c app\_Start() 2926 | Starting app ‘my\_app’  
Oct 8 14:46:47 swi-mdm9x28-wp user.info Legato: INFO | supervisor[843]/supervisor T=main | app.c CreateFileLink() 1619 | Created file link ‘/legato/systems/current/apps/my\_app/read-only/bin/my\_app’ to '/legato/systems/current/appsWriteable/my\_app/  
Oct 8 14:46:47 swi-mdm9x28-wp user.info Legato: INFO | supervisor[843]/supervisor T=main | app.c CreateFileLink() 1549 | Skipping file link ‘/legato/systems/current/apps/my\_app/read-only/bin/my\_app’ to '/legato/systems/current/appsWriteable/my\_app  
Oct 8 14:46:47 swi-mdm9x28-wp user.info Legato: INFO | supervisor[843]/supervisor T=main | app.c CreateFileLink() 1619 | Created file link ‘/legato/systems/current/apps/my\_app/read-only/usr/lib/libcares.so.2.2.0’ to '/legato/systems/current/appsWriteable/my\_app/us  
Oct 8 14:46:47 swi-mdm9x28-wp user.info Legato: INFO | supervisor[843]/supervisor T=main | app.c CreateFileLink() 1619 | Created file link ‘/legato/systems/current/apps/my\_app/read-only/usr/lib/libgflags.so.2.2.0’ to '/legato/systems/current/appsWriteable/my\_app/u  
Oct 8 14:46:47 swi-mdm9x28-wp user.info Legato: INFO | supervisor[843]/supervisor T=main | app.c CreateFileLink() 1619 | Created file link ‘/legato/systems/current/apps/my\_app/read-only/usr/lib/libgflags\_nothreads.so.2.2.0’ to '/legato/systems/current/appsWriteable/fil  
Oct 8 14:46:47 swi-mdm9x28-wp user.info Legato: INFO | supervisor[843]/supervisor T=main | app.c CreateFileLink() 1619 | Created file link ‘/legato/systems/current/apps/my\_app/read-only/usr/lib/libglog.so.0’ to '/legato/systems/current/appsWriteable/my\_app/usr/lib  
Oct 8 14:46:47 swi-mdm9x28-wp user.info Legato: INFO | supervisor[843]/supervisor T=main | app.c CreateFileLink() 1619 | Created file link ‘/legato/systems/current/apps/my\_app/read-only/usr/lib/libprotobuf-lite.so.15.0.1’ to '/legato/systems/current/appsWriteable/file\_  
Oct 8 14:46:47 swi-mdm9x28-wp user.info Legato: INFO | supervisor[843]/supervisor T=main | app.c CreateFileLink() 1619 | Created file link ‘/legato/systems/current/apps/my\_app/read-only/usr/lib/libprotobuf.so.15.0.1’ to '/legato/systems/current/appsWriteable/file\_uploa  
Oct 8 14:46:47 swi-mdm9x28-wp user.info Legato: INFO | supervisor[843]/supervisor T=main | app.c CreateFileLink() 1619 | Created file link ‘/legato/systems/current/apps/my\_app/read-only/usr/lib/libprotoc.so.15.0.1’ to '/legato/systems/current/appsWriteable/my\_app/  
Oct 8 14:46:47 swi-mdm9x28-wp user.info Legato: INFO | supervisor[843]/supervisor T=main | app.c CreateFileLink() 1619 | Created file link ‘/legato/systems/current/apps/my\_app/read-only/usr/lib/libsqlite.so.0.8.6’ to '/legato/systems/current/appsWriteable/my\_app/u  
Oct 8 14:46:47 swi-mdm9x28-wp user.info Legato: INFO | supervisor[843]/supervisor T=main | app.c CreateFileLink() 1619 | Created file link ‘/legato/systems/current/apps/my\_app/read-only/usr/lib/libsqlite3.so.0.8.6’ to '/legato/systems/current/appsWriteable/my\_app/  
Oct 8 14:46:47 swi-mdm9x28-wp user.info Legato: INFO | supervisor[843]/supervisor T=main | app.c CreateFileLink() 1619 | Created file link ‘/legato/systems/current/apps/my\_app/read-only/usr/lib/libunwind-arm.so.8.0.1’ to '/legato/systems/current/appsWriteable/file\_uplo  
Oct 8 14:46:47 swi-mdm9x28-wp user.info Legato: INFO | supervisor[843]/supervisor T=main | app.c CreateFileLink() 1619 | Created file link ‘/legato/systems/current/apps/my\_app/read-only/usr/lib/libunwind-coredump.so.0.0.0’ to '/legato/systems/current/appsWriteable/file  
Oct 8 14:46:47 swi-mdm9x28-wp user.info Legato: INFO | supervisor[843]/supervisor T=main | app.c CreateFileLink() 1619 | Created file link ‘/legato/systems/current/apps/my\_app/read-only/usr/lib/libunwind-ptrace.so.0.0.0’ to '/legato/systems/current/appsWriteable/file\_u  
Oct 8 14:46:47 swi-mdm9x28-wp user.info Legato: INFO | supervisor[843]/supervisor T=main | app.c CreateFileLink() 1619 | Created file link ‘/legato/systems/current/apps/my\_app/read-only/usr/lib/libunwind-setjmp.so.0.0.0’ to '/legato/systems/current/appsWriteable/file\_u  
Oct 8 14:46:47 swi-mdm9x28-wp user.info Legato: INFO | supervisor[843]/supervisor T=main | app.c CreateFileLink() 1619 | Created file link ‘/legato/systems/current/apps/my\_app/read-only/usr/lib/libunwind.so.8.0.1’ to '/legato/systems/current/appsWriteable/my\_app/u  
Oct 8 14:46:47 swi-mdm9x28-wp user.info Legato: INFO | supervisor[843]/supervisor T=main | resourceLimits.c SetRLimitValue() 282 | Setting resource limit maxCoreDumpFileBytes to value 102400.  
Oct 8 14:46:47 swi-mdm9x28-wp user.info Legato: INFO | supervisor[843]/supervisor T=main | resourceLimits.c SetRLimitValue() 282 | Setting resource limit maxFileBytes to value 102400.  
Oct 8 14:46:47 swi-mdm9x28-wp user.info Legato: INFO | supervisor[843]/supervisor T=main | resourceLimits.c SetRLimitValue() 282 | Setting resource limit maxLockedMemoryBytes to value 8192.  
Oct 8 14:46:47 swi-mdm9x28-wp user.info Legato: INFO | supervisor[843]/supervisor T=main | resourceLimits.c SetRLimitValue() 282 | Setting resource limit maxFileDescriptors to value 256.  
Oct 8 14:46:47 swi-mdm9x28-wp user.info Legato: INFO | supervisor[843]/supervisor T=main | resourceLimits.c SetRLimitValue() 282 | Setting resource limit maxMQueueBytes to value 512.  
Oct 8 14:46:47 swi-mdm9x28-wp user.info Legato: INFO | supervisor[843]/supervisor T=main | resourceLimits.c SetRLimitValue() 282 | Setting resource limit maxThreads to value 20.  
Oct 8 14:46:47 swi-mdm9x28-wp user.info Legato: INFO | supervisor[843]/supervisor T=main | resourceLimits.c SetRLimitValue() 282 | Setting resource limit maxQueuedSignals to value 100.  
Oct 8 14:46:47 swi-mdm9x28-wp user.info Legato: INFO | supervisor[843]/supervisor T=main | proc.c proc\_Start() 1389 | Starting process ‘my\_app’ with pid 26850  
Oct 8 14:46:47 swi-mdm9x28-wp user.info Legato: INFO | updateDaemon[857]/updateDaemon T=main | app.c app\_InstallIndividual() 788 | App my\_app \<0c8ebde1333c6a66c5bf20a759bbe78c\> installed  
Oct 8 14:46:47 swi-mdm9x28-wp user.info Legato: INFO | updateDaemon[857]/updateDaemon T=main | updateDaemon.c ApplyAppUpdate() 914 | App ‘my\_app\<0c8ebde1333c6a66c5bf20a759bbe78c\>’ installed properly.  
Oct 8 14:46:47 swi-mdm9x28-wp user.info Legato: INFO | updateDaemon[857]/updateDaemon T=main | updateDaemon.c StartProbation() 218 | System on probation (timer started).  
Oct 8 14:46:47 swi-mdm9x28-wp user.info Legato: INFO | supervisor[843]/supervisor T=main | supervisor.c SigChildHandler() 783 | Reaping unconfigured child process 26846.  
Oct 8 14:46:47 swi-mdm9x28-wp user.info Legato: INFO | supervisor[26850]/supervisor T=main | proc.c proc\_Start() 1354 | Execing ‘my\_app’  
Oct 8 14:46:47 swi-mdm9x28-wp user.info Legato: INFO | avcDaemon[912]/avcDaemon T=main | avcAppUpdate.c NotifyObj9List() 691 | Found 4 object 9 instances  
Oct 8 14:46:47 swi-mdm9x28-wp authpriv.info dropbear[26656]: Exit (root): Disconnect received  
Oct 8 14:46:47 swi-mdm9x28-wp user.info Legato: INFO | avcDaemon[912]/avcDaemon T=main | avcAppUpdate.c NotifyObj9List() 692 | obj9ListLen; 51 obj9List: \</lwm2m/9/0\>,\</lwm2m/9/1\>,\</lwm2m/9/2\>,\</lwm2m/9/3\>  
Oct 8 14:46:47 swi-mdm9x28-wp user.err Legato: =ERR= | my\_app[26850] | my\_app: error while loading shared libraries: libglog.so.0: cannot open shared object file: No such file or directory  
Oct 8 14:46:47 swi-mdm9x28-wp user.info Legato: INFO | supervisor[843]/supervisor T=main | proc.c proc\_SigChildHandler() 2035 | Process ‘my\_app’ (PID: 26850) has exited with exit code 127.  
Oct 8 14:46:47 swi-mdm9x28-wp user.warn Legato: -WRN- | supervisor[843]/supervisor T=main | app.c app\_SigChildHandler() 3480 | Process ‘my\_app’ in app ‘my\_app’ faulted: Ignored.  
Oct 8 14:46:47 swi-mdm9x28-wp user.warn Legato: -WRN- | \_appStopClient[26851]/framework T=main | LE\_FILENAME CreateSocket() 550 | Socket opened as standard i/o file descriptor 2!  
Oct 8 14:46:47 swi-mdm9x28-wp user.info Legato: INFO | supervisor[843]/supervisor T=main | apps.c DeactivateAppContainer() 374 | Application ‘my\_app’ has stopped.

Can someone help?

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/jyijyi/32/822_2.png) [@jyijyi](https://forum.legato.io/u/jyijyi)\
**Post date:** [December 26, 2019, 12:31pm UTC](https://forum.legato.io/t/adding-third-party-libraries/4755/3 "2019-12-26T12:31:02Z")

</div>

my\_app: error while loading shared libraries: libglog.so.0: cannot open shared object file: No such file or directory

Seems when you set to unsandboxed app, it will go to the real path /usr/lib to find the library.  
Maybe you can set to sandboxed to true.
