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 (curl.haxx.se/download.html)
I’ve done it for you in the attached archive (Caution: I’ve named it .zip to workaround the forum filter, but this is a .tar.xz file; please rename it before usage)
libcurl.zip (823 KB)
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:
Now the app should build.
To test it, I’ve written that code:
LE_INFO("curl try: %s", curl_version());
And then I’m getting this in the logs:
Jan 6 01:06:42 | Legato | testwithcurl/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.