I am trying to make a small program to fetch the 2d location like below for mangoh red wp76xx
#include <stdio.h>
#include “legato.h”
#include “le_info_interface.h”
#include “le_pos_interface.h”
int main(int argc, char** argv)
{
LE_INFO(“Fetcing 2D location \n”);
le_result_t res;
int32_t latitude = 0;
int32_t longitude = 0;
int32_t hAccuracy = 0;
res = le_pos_Get2DLocation(&latitude, &longitude, &hAccuracy);
if (res == LE_OK)
{
LE_INFO("Location: latitude=%d, longitude=%d, hAccuracy=%d", latitude, longitude, hAccuracy);
}
else if (res == LE_FAULT)
{
LE_INFO("Failed to get the 2D location's data");
}
else if (res == LE_OUT_OF_RANGE)
{
LE_INFO("One of the retrieved parameter is invalid (set to INT32_MAX)");
}
else
{
LE_INFO("unknown location error (%d)", res);
}
}
Below is the compilation link error which I am facing.
mangoh@mangoh-vm:~/legato_framework/legato/apps/sample/legacy/useLegatoApi$ $CC -c main.c -I$LEGATO_ROOT/framework/include
mangoh@mangoh-vm:~/legato_framework/legato/apps/sample/legacy/useLegatoApi$ $CC -o legacy main.o le_info_client.o -L$LEGATO_ROOT/build/wp76xx/framework/lib -llegato -lpthread -lrt
main.o: In function main': main.c:(.text+0xa8): undefined reference to
le_pos_Get2DLocation’
collect2: error: ld returned 1 exit status
mangoh@mangoh-vm:~/legato_framework/legato/apps/sample/legacy/useLegatoApi$
Am I missing some dependency. Is the right way to fetch 2d location from legacy app.
Thanks