# Can't find include files

**URL:** <https://forum.legato.io/t/cant-find-include-files/5035>\
**Category:** VSCode\
**Created:** [February 27, 2020, 3:49pm UTC](https://forum.legato.io/t/cant-find-include-files/5035 "2020-02-27T15:49:37Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![piinst](https://avatars.discourse-cdn.com/v4/letter/p/919ad9/32.png) [@piinst](https://forum.legato.io/u/piinst)\
**Post date:** [February 27, 2020, 3:49pm UTC](https://forum.legato.io/t/cant-find-include-files/5035/1 "2020-02-27T15:49:37Z")

</div>

Can’t find include files for demo app. Plugin 1.0. Anyone else having this problem?

```auto
// testAppComponent.c
//
// Specifies the main source file of the component. Add initialization and event registrations to
// the files COMPONE NT_INIT functions.

// Include the core framework C APIs.
#include "legato.h"

// Include your component's API interfaces.
#include "interfaces.h"

// This function is called only once on startup. Place your initialization and event registration
// here.
COMPONENT_INIT
{
    // Write in the log that this component has started.
    LE_INFO("Component testAppComponent started.");
}

```

---

<div class="post-metadata">

**Author:** ![lpacyk](https://avatars.discourse-cdn.com/v4/letter/l/bbce88/32.png) [@lpacyk](https://forum.legato.io/u/lpacyk)\
**Post date:** [February 28, 2020, 2:17am UTC](https://forum.legato.io/t/cant-find-include-files/5035/2 "2020-02-28T02:17:12Z")

</div>

Hi @piinst

You are not alone, I see this error come up as well.  
As far as I can tell the build scripts have no issue finding them so it can be ignored for now until it gets fixed.

---

<div class="post-metadata">

**Author:** ![lpacyk](https://avatars.discourse-cdn.com/v4/letter/l/bbce88/32.png) [@lpacyk](https://forum.legato.io/u/lpacyk)\
**Post date:** [March 10, 2020, 6:08pm UTC](https://forum.legato.io/t/cant-find-include-files/5035/3 "2020-03-10T18:08:57Z")

</div>

Hi @piinst

I would like to get some more information.

- Are both include statements showing errors?
- What is the error message(s) that you receive?

Also could you check if the following resolves your issue?

1. Press the “Terminal” tab in the top window toolbar.
2. Select “Run Task” then select “Legato: Build” and wait for it to finish

---

<div class="post-metadata">

**Author:** ![piinst](https://avatars.discourse-cdn.com/v4/letter/p/919ad9/32.png) [@piinst](https://forum.legato.io/u/piinst)\
**Post date:** [March 10, 2020, 6:40pm UTC](https://forum.legato.io/t/cant-find-include-files/5035/4 "2020-03-10T18:40:57Z")

</div>

Thanks for the reply.

At first I get an error underline on “#include interfaces.h”. I do ctl-shift-B and select “gcc build active file”, it then proceeds to build Legato and the error underline goes away. I repeat the build request and this time it tries to build my app and tells me it can’t find legato.h.

Going through “Run Task” results in the same thing, Legato builds but when I try to build my app it gets can’t find legato.h.

This info may be useful: when I click on “TERMINAL” and enter “env” I don’t see the environment variables that leaf sets up when I run the leaf shell (this seems to happen only the first time). I can build apps from the command line OK using leaf shell.

 ![Screenshot from 2020-03-10 14-33-50](https://us1.discourse-cdn.com/flex019/uploads/legato1/original/1X/95290e3f7d9c9f9ae7fc50be49689d6f648833d8.png)

---

<div class="post-metadata">

**Author:** ![lpacyk](https://avatars.discourse-cdn.com/v4/letter/l/bbce88/32.png) [@lpacyk](https://forum.legato.io/u/lpacyk)\
**Post date:** [March 13, 2020, 11:58pm UTC](https://forum.legato.io/t/cant-find-include-files/5035/5 "2020-03-13T23:58:54Z")

</div>

> [@piinst](#):
>
> At first I get an error underline on “#include interfaces.h”. I do ctl-shift-B and select “gcc build active file”, it then proceeds to build Legato and the error underline goes away. I repeat the build request and this time it tries to build my app and tells me it can’t find legato.h.
> 
> Going through “Run Task” results in the same thing, Legato builds but when I try to build my app it gets can’t find legato.h.

When you press Ctl-shift-B do you see a build task with the name “Legato: Build” or “Legato: Build and Install”?

Those will be the ones you want to use in order to build a legato system. Leaf tool mksys will be used to locate link and compile all necessary files using internally.

> [@piinst](#):
>
> This info may be useful: when I click on “TERMINAL” and enter “env” I don’t see the environment variables that leaf sets up when I run the leaf shell (this seems to happen only the first time). I can build apps from the command line OK using leaf shell.

In order to see your leaf environment variables you will need to open a leaf shell terminal.

You can do this in two ways

- Press Ctl-Shift-P and in the menu find the task “Leaf: Open Leaf Shell”
- In terminal enter “leaf shell” in your work directory.

Leaf configures all the environment variables required to build the system but does so in its own contained shell to keep the work directory isolated from the rest of the system.

Let me know if this resolves both your issues

---

<div class="post-metadata">

**Author:** ![piinst](https://avatars.discourse-cdn.com/v4/letter/p/919ad9/32.png) [@piinst](https://forum.legato.io/u/piinst)\
**Post date:** [March 16, 2020, 5:20pm UTC](https://forum.legato.io/t/cant-find-include-files/5035/6 "2020-03-16T17:20:09Z")

</div>

Thanks for the suggestions.

Ctl-shift-B “Legato: Build” will build my app without errors and I can install and run it on the WP7700. But do I have to have to build Legato again just to build the app? Time consuming.

---

<div class="post-metadata">

**Author:** ![lpacyk](https://avatars.discourse-cdn.com/v4/letter/l/bbce88/32.png) [@lpacyk](https://forum.legato.io/u/lpacyk)\
**Post date:** [March 28, 2020, 12:33am UTC](https://forum.legato.io/t/cant-find-include-files/5035/7 "2020-03-28T00:33:33Z")

</div>

@piinst

You can choose to build just your app by switching your active sdef, to the adef of the application you would like to build.

To change the active definition file select it in the status bar at the bottom, I have attached a screenshot to help you locate it.

 ![Screenshot from 2020-03-27 17-17-12](https://us1.discourse-cdn.com/flex019/uploads/legato1/original/1X/80a1a8a191b74649b14ce46325433bf4db167109.png)

---

<div class="post-metadata">

**Author:** ![piinst](https://avatars.discourse-cdn.com/v4/letter/p/919ad9/32.png) [@piinst](https://forum.legato.io/u/piinst)\
**Post date:** [March 30, 2020, 5:49pm UTC](https://forum.legato.io/t/cant-find-include-files/5035/8 "2020-03-30T17:49:48Z")

</div>

Yes that does it, only app is built. I hope more material like this is added to the web page for VS Code, I can see it’s been expanded a bit lately but more could be done.  
Thanks!
