Hi, I am trying a sample application for connecting mangOH Green to Google Cloud.
After spending some time for porting the example as per updated libraries on which the application depends, I am facing an issue with linking a shared library called libjansson.
I referred the documentation and procedure to compile and install the Jansson library from the Getting Started page on their website.
In my Component.cdef, I have:
ldflags:
{
-ljansson -ljwt -lcrypto -L/usr/local/lib
}
Problem statement:
When I build the code, I get following error.
/usr/local/lib/libjansson.so: file not recognized: File format not recognized
My interpretation of the issue is, is the problem with not cross-compiling libjansson? I have compiled Jansson straight and simple, do I have to build it with any considerations for legato?
The documentation for Jansson has a CMake section, which says,
By default the CMake project will generate build files for building the static library. To build the shared version use: cmake -DJANSSON_BUILD_SHARED_LIBS=1
I have done this step.
Is there anything else specific to legato?
What I have tried:
To know if the Jansson is properly installed or not, I wrote a simple ‘Hello World’ program in C and it had a
#include <jansson.h>
and was build using
gcc -o HelloWorld hello.c -ljansson
And, it did not report any linker errors related to Jansson (or libjansson.so)
Additional details if required:
Existing system:
-
I have installed legato17-08.1 on my host (linux - ubuntu16.04 LTS) computer, used a zip, did not clone.
-
I have installed latest toolchain (Release 14) from sierra wireless.
-
I have installed legato application developer studio version 5.2.
-
I have a mangOH Green board with me, it has a WP8548 chip on it and I have tested it with helloWorld program that I built and deployed on the device using legato application developer studio version 5.2.
-
I am aware of the process of running ‘bin/legs’ every time I open a terminal for supporting commands related to legato.
-
I have been able to build (on command line) sample applications provided by legato.