New Yocto build to add a library


I’ve been trying to include a 3rd party library(libcurl) to my DS project for mangOH without success.
Is it possible that in order to include the library I need to make a new build for the Yocto including it? In that case do you have an example or a guide on how to do it?
If that’s not the way to do it could you please tell me how it’s done?

Thank you,


The curl package that includes libcurl is already part of the yocto-1.7 build for MangOH boards:
$ bitbake-layers show-recipes curl
Parsing recipes…done.
=== Available recipes matching curl: ===
meta 7.37.1

This gets built and installed on the MangOH board by default:
root@swi-mdm9x15:~# which curl
root@swi-mdm9x15:~# ls /usr/lib/curl
/usr/lib/ /usr/lib/

If you are looking for a custom curl library/package, you can add its recipe to the Yocto build. For this procedure, it is best to follow the instructions on the Yocto site: … o_Yocto.3F


Thanks for your answer. I’ve tried what you told me and i noticed that i didn’t have the last version of the mangOH software, i had 16.01Beta.
I updated it to 16.04 and the Ubuntu VM too.

Now I’ve the libcurl on the board, but can’t include it to my DS project. Can you help me with that?


Indeed it looks like the libcurl is not available in the toolchain. We’ll have a look at this to fix that ASAP.
In the meantime, here is a workaround.

First of all, you’ll need *.so files (libcurl + dependencies) to provide to the linker, and header files to be included in your code.
It is possible to directly grab the so files from the device, and the header files from the curl website (
I’ve done it for you in the attached archive ([color=#FF0000]Caution: I’ve named it .zip to workaround the forum filter, but this is a .tar.xz file; please rename it before usage[/color])

I suggest you to extract the content of the file to a libcurl sub-directory of your application project.
Then, you’ll need to update your app settings.

In Project properties > C/C++ Build > Settings > mkapp Tool > C build options > Additional Linker Options area, add the following options:
This should look like this:

Then, in Project properties > Legato application > API directories, add a workspace path and point to your libcurl/include directory:

Then, we need to configure the bindings to import the libs inside the sandbox at runtime; I’ve done it in the Component.cdef file:


requires: {
	file: {
		/usr/lib/		/lib/
		/usr/lib/		/lib/
		/usr/lib/		/lib/
		/usr/lib/	/lib/
		/usr/lib/		/lib/
		/lib/			/lib/

Now the app should build.
To test it, I’ve written that code:

#include "legato.h"
#include "curl.h"

    LE_INFO("curl try: %s", curl_version());

And then I’m getting this in the logs:

Jan  6 01:06:42 | Legato | testwithcurl[17135]/testWithCurlComponent T=main | testWithCurl.c _testWithCurlComponent_COMPONENT_INIT() 6 | curl try: libcurl/7.37.1 GnuTLS/3.3.5 zlib/1.2.8

Hope this will help.

1 Like