# Cannot build legacy 'useLegatoApi' app

**URL:** <https://forum.sierrawireless.com/t/cannot-build-legacy-uselegatoapi-app/12051>\
**Category:** Uncategorized\
**Created:** [June 11, 2015, 6:52pm UTC](https://forum.sierrawireless.com/t/cannot-build-legacy-uselegatoapi-app/12051 "2015-06-11T18:52:29Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![pivaz](https://avatars.discourse-cdn.com/v4/letter/p/8baadc/32.png) [@pivaz](https://forum.sierrawireless.com/u/pivaz)\
**Post date:** [June 11, 2015, 6:52pm UTC](https://forum.sierrawireless.com/t/cannot-build-legacy-uselegatoapi-app/12051/1 "2015-06-11T18:52:29Z")

</div>

I am trying to compile sample app ‘useLegatoApi’, but I am running into the following two errors:

$ cd /legato-af/apps/samples/legace/useLegatoApi  
$ make wp85  
mkcomp --stand-alone -t wp85 -i /home/pivaz/Legato/legato-af/interfaces/modemServices api\_client  
[3/3] /opt/swi/y16-ext/sysroots/x86\_64-pokysdk-linux/usr/bin/arm-poky-linux-…6de55acfa7a2f/client/le\_info\_client.c.o -Wall -fPIC -Werror -DMK\_TOOLS\_BUIL  
/opt/swi/y16-ext/sysroots/x86\_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-gcc -c main.c -I\_build -I/home/pivaz/Legato/legato-af/framework/c/inc  
main.c:3:24: fatal error: interfaces.h: No such file or directory  
compilation terminated.  
make: \*\*\* [main.o] Error 1

‘mkcomp …’ creates the ‘\_build’ folder. “interfaces.h” is inside folder, but its path is '\_build/component/api\_client/src/interfaces.h", looking at the makefile the expected location should be “\_build/interfaces.h”. Similar thing for “le\_info\_interfaces.h”, its actual location is “\_build/api/ec20858f80d55f58b606de55acfa7a2f/client/le\_info\_interface.h”, not “\_build/le\_info\_interfaces.h”

Attempted solution:

I modified the makefile to include ‘-I \_build/api/ec20858f80d55f58b606de55acfa7a2f/client/’ and ‘-I \_build/component/api\_client/src’, and that gets me past the ‘interfaces.h: no such file or directory’ problem…but then the make can’t find libIF\_le\_info\_client.so.

$ make wp85  
mkcomp --stand-alone -t wp85 -i /home/pivaz/Legato/legato-af/interfaces/modemServices api\_client  
[3/3] /opt/swi/y16-ext/sysroots/x86\_64-pokysdk-linux/usr/bin/arm-poky-linux-…6de55acfa7a2f/client/le\_info\_client.c.o -Wall -fPIC -Werror -DMK\_TOOLS\_BUIL  
/opt/swi/y16-ext/sysroots/x86\_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-gcc -c main.c -I\_build -I\_build/component/api\_client/src -I\_build/api/ec20858f80d55f58b606de55acfa7a2f/client -I/home/pivaz/Legato/legato-af/framework/c/inc  
/opt/swi/y16-ext/sysroots/x86\_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-gcc -o legacy main.o libIF\_le\_info\_client.so -L/home/pivaz/Legato/legato-af/build/wp85/bin/lib -llegato  
arm-poky-linux-gnueabi-gcc: error: libIF\_le\_info\_client.so: No such file or directory  
make: \*\*\* [legacy] Error 1

I checked $LEGATO\_ROOT/build/wp85/bin/lib, could not find the .so file there.

Note: I have ninja-build installed.

Host: Ubuntu 14.04 x64  
Modem: WP85  
Legato: 15.05 Beta

---

<div class="post-metadata">

**Author:** ![davidc](https://avatars.discourse-cdn.com/v4/letter/d/a183cd/32.png) [@davidc](https://forum.sierrawireless.com/u/davidc)\
**Post date:** [June 11, 2015, 10:11pm UTC](https://forum.sierrawireless.com/t/cannot-build-legacy-uselegatoapi-app/12051/2 "2015-06-11T22:11:04Z")

</div>

Hiya,

interfaces.h is built from your component, rather than being a system header file.

As a first thought, check that your cdef and adef files are correct.

This is all pretty new to us!

ciao, Dave

---

<div class="post-metadata">

**Author:** ![pivaz](https://avatars.discourse-cdn.com/v4/letter/p/8baadc/32.png) [@pivaz](https://forum.sierrawireless.com/u/pivaz)\
**Post date:** [June 11, 2015, 10:44pm UTC](https://forum.sierrawireless.com/t/cannot-build-legacy-uselegatoapi-app/12051/3 "2015-06-11T22:44:20Z")

</div>

The api\_client/Component.cdef file is directly from the repository, I have not made any modifications to it.

---

<div class="post-metadata">

**Author:** ![kmurphy](https://avatars.discourse-cdn.com/v4/letter/k/22d042/32.png) [@kmurphy](https://forum.sierrawireless.com/u/kmurphy)\
**Post date:** [June 17, 2015, 11:44pm UTC](https://forum.sierrawireless.com/t/cannot-build-legacy-uselegatoapi-app/12051/4 "2015-06-17T23:44:42Z")

</div>

Hello,

The sample required some updates, which should be uploaded to GitHub soon. In the mean time, I’m including the code here.

The changes include:

- Changing main.c to include le\_info\_interface.h directly instead of through interfaces.h
- Adding code to the component to auto initialize the client interface.
- Change to the makefile to autocratically find the generated interface directory.
- Change to the makefile to specify an output file for the component build.

[attachment=0]useLegatoApi.tar.gz[/attachment]

---

<div class="post-metadata">

**Author:** ![kmurphy](https://avatars.discourse-cdn.com/v4/letter/k/22d042/32.png) [@kmurphy](https://forum.sierrawireless.com/u/kmurphy)\
**Post date:** [June 18, 2015, 12:01am UTC](https://forum.sierrawireless.com/t/cannot-build-legacy-uselegatoapi-app/12051/5 "2015-06-18T00:01:52Z")

</div>

Sorry the forum seems to be having problems with attachments. If you want, you can PM me with an email address I can directly email the code to.

-Kelly
