# Description	Resource Path Location	Issue

**URL:** <https://forum.legato.io/t/description-resource-path-location-issue/2651>\
**Category:** Legato Application Framework\
**Created:** [September 5, 2017, 4:00am UTC](https://forum.legato.io/t/description-resource-path-location-issue/2651 "2017-09-05T04:00:16Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![lumao](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/lumao/32/167_2.png) [@lumao](https://forum.legato.io/u/lumao)\
**Post date:** [September 5, 2017, 4:00am UTC](https://forum.legato.io/t/description-resource-path-location-issue/2651/1 "2017-09-05T04:00:16Z")

</div>

Hi,  
Today I download a legato project from network, and try to import the project, but it was failed .  
Error outputs:

```
Description	Resource	Path	Location	Type
Couldn't find file '$MANGOH_ROOT/apps/MqttClient/mqtt.api'.	Component.cdef	/mqttClient/mqttClientComp	line 37	C/C++ Problem

```

What does $MANGOH\_ROOT means? And how can I solve this bug?

 ![Screenshot from 2017-09-05 11:57:32](https://us1.discourse-cdn.com/flex019/uploads/legato1/original/1X/0d4024e2ee7f3d2aceb2cdeaad46f5ff0bc4fbd9.png)

Thanks.

---

<div class="post-metadata">

**Author:** ![daav](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/daav/32/64_2.png) [@daav](https://forum.legato.io/u/daav)\
**Post date:** [September 5, 2017, 5:20am UTC](https://forum.legato.io/t/description-resource-path-location-issue/2651/2 "2017-09-05T05:20:14Z")

</div>

Hi @lumao

my guess is that you’re trying to reuse the **mqttClient** app of the mangOH system, without cloning the full mangOH github repository (with sub-modules), correct?

Case 1:  
If you already have the full mangOH clone, you can define the **MANGOH\_ROOT** env var in your **mqttClient** project properties ( **C/C++ Build \> Environment** ), and make it pointing to your clone root, so that the **$MANGOH\_ROOT/apps/MqttClient** path can be resolved.

Case 2:  
If you simply cloned the mqttClient app, I’m afraid that you’ll need to update the CDEF file, in order to replace the **$MANGOH\_ROOT/apps/MqttClient/mqttClientComp** path by the **$CURDIR** variable (representing the directory that contains the current def file).  
(Side note: by the way, we have a pending bug that makes the def files editors freezing when one type the **$** char, so be careful…)  
There will probably some other files to update.  
I’ll take some time to try adapting the project, and check with the team how we could make this kind of use case easier.

---

<div class="post-metadata">

**Author:** ![lumao](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/lumao/32/167_2.png) [@lumao](https://forum.legato.io/u/lumao)\
**Post date:** [September 5, 2017, 6:01am UTC](https://forum.legato.io/t/description-resource-path-location-issue/2651/3 "2017-09-05T06:01:36Z")

</div>

daav,  
Thank you for your information.  
Yes, I simply cloned the mqttClient app only. I think I should update the .cdef file.  
For the issue to type the ‘$’ char, I can copy and paste the string '$CURDIR ’ instead of type one by one.

Thank you again!

---

<div class="post-metadata">

**Author:** ![daav](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/daav/32/64_2.png) [@daav](https://forum.legato.io/u/daav)\
**Post date:** [September 5, 2017, 6:28am UTC](https://forum.legato.io/t/description-resource-path-location-issue/2651/4 "2017-09-05T06:28:25Z")

</div>

I’ve forked the MqttClient app, to give a try.  
Please have a look at this commit to get the necessary updates for a standalone build:  
[https://github.com/swiDeveloperStudio/MqttClient/commit/d2623d6d9ec1f3ae45b8f327f5056d87fa5eefb7](https://github.com/swiDeveloperStudio/MqttClient/commit/d2623d6d9ec1f3ae45b8f327f5056d87fa5eefb7)

---

<div class="post-metadata">

**Author:** ![lumao](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/lumao/32/167_2.png) [@lumao](https://forum.legato.io/u/lumao)\
**Post date:** [September 5, 2017, 7:00am UTC](https://forum.legato.io/t/description-resource-path-location-issue/2651/5 "2017-09-05T07:00:50Z")

</div>

daav,

Perfect! Thank you very much!

It is working now.  
connectComp/component.cdef

```
requires:
{
    api:
    {
        //$MANGOH_ROOT/apps/MqttClient/mqtt.api
        mqtt.api
    }
}

sources:
{
    connect.c
}

```

disconnectComp/component.cdef

```
requires:
{
    api:
    {
        //$MANGOH_ROOT/apps/MqttClient/mqtt.api
        mqtt.api
    }
}

sources:
{
    disconnect.c
}

```

mqttClientComp/component.cdef

```
sources:
{
    mqttMain.c
    src/mqttClient.c
    src/mqtt/mqttConnectClient.c
    src/mqtt/mqttConnectServer.c
    src/mqtt/mqttUnsubscribeClient.c
    src/mqtt/mqttUnsubscribeServer.c
    src/mqtt/mqttSerializePublish.c
    src/mqtt/mqttSubscribeClient.c
    src/mqtt/mqttDeserializePublish.c
    src/mqtt/mqttSubscribeServer.c
    src/mqtt/mqttPacket.c
    src/json/swir_json.c
}

requires:
{
    api:
    {
        le_data.api
        modemServices/le_info.api
        //receiverApi.api
        
    }
}

cflags:
{
    //-I$MANGOH_ROOT/apps/MqttClient/mqttClientComp/inc
    //-I$MANGOH_ROOT/apps/MqttClient/mqttClientComp/inc/mqtt
    -I$CURDIR/inc
    -I$CURDIR/inc/mqtt
}

provides:
{
    api:
    {
        //$MANGOH_ROOT/apps/MqttClient/mqtt.api
        mqtt.api
    }
}

```

sendComp/component.cdef

```
requires:
{
    api:
    {
        //$MANGOH_ROOT/apps/MqttClient/mqtt.api
        mqtt.api
    }
}

sources:
{
    send.c
}

```

Thank you!

Regards!

---

<div class="post-metadata">

**Author:** ![daav](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/daav/32/64_2.png) [@daav](https://forum.legato.io/u/daav)\
**Post date:** [September 11, 2017, 7:59am UTC](https://forum.legato.io/t/description-resource-path-location-issue/2651/6 "2017-09-11T07:59:16Z")

</div>

Hi @lumao

FYI, MangOH sub-modules projects have been updated to make them independent from the **MANGOH\_ROOT** env var.  
So from now, cloning directly from [GitHub - mangOH/MqttClient](https://github.com/mangOH/MqttClient) will give a working project.

By the way, please note that you can clone directly from DS:

- Copy the clone URL from the github page
- In DS, create a new project and select the **Legato Project from Git repository existing code** wizard
- Select the **Clone URI** option
- Then follow the steps…

This way you’ll get the project directly in DS without needing to clone before.

---

<div class="post-metadata">

**Author:** ![lumao](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/lumao/32/167_2.png) [@lumao](https://forum.legato.io/u/lumao)\
**Post date:** [September 11, 2017, 8:19am UTC](https://forum.legato.io/t/description-resource-path-location-issue/2651/7 "2017-09-11T08:19:36Z")

</div>

daav,

Thank you very much!

It would be a great help for me.

Thanks again!

Best Regards!
