How to link third-party static library


#1

I have searched Hi and Low and cannot find a example of how to link a third-party static library in a legato application , the reason I am in this scenario is because the only library I do have and can compile is a static library. Any Help or advice would be appreciated .


#2

Did you try adding the following in .cdef file:


bundles:
{
file:
{
[rx] /home/owner/Downloads/libmodule.so /lib/
}
}
requires: {
lib: {
/home/owner/Downloads/libmodule.so
}


For more information, please see:


#3

Hi Guys thanks for the reply but it was quite simple linking a third party static library eg. azure iot client.

ldflags:
{
-lssl --> shared library
-lcrypto --> shared library
-L $CURDIR/third-party/lib --> PATH of static third party libs
-liothub_client --> static
-liothub_client_mqtt_transport --> static
-liothub_client_mqtt_ws_transport – static
-laziotsharedutil – static
-lserializer – static
-lumqtt – static
}