Description Resource Path Location Issue

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?

Thanks.

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.

1 Like

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!

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

1 Like

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!

1 Like

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 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.

1 Like

daav,

Thank you very much!

It would be a great help for me.

Thanks again!

Best Regards!