Can't find include files

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

// 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.
    // Write in the log that this component has started.
    LE_INFO("Component testAppComponent started.");

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.

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

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.

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.

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

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.


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.

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.