# Legato Config Tree undefined reference to 'le\_cfg\_...'

**URL:** <https://forum.legato.io/t/legato-config-tree-undefined-reference-to-le-cfg/5937>\
**Category:** Legato Application Framework\
**Created:** [August 19, 2021, 3:25pm UTC](https://forum.legato.io/t/legato-config-tree-undefined-reference-to-le-cfg/5937 "2021-08-19T15:25:09Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![david.geffers](https://avatars.discourse-cdn.com/v4/letter/d/65b543/32.png) [@david.geffers](https://forum.legato.io/u/david.geffers)\
**Post date:** [August 19, 2021, 3:25pm UTC](https://forum.legato.io/t/legato-config-tree-undefined-reference-to-le-cfg/5937/1 "2021-08-19T15:25:09Z")

</div>

I encountered following error for my app with legato 19.11

```
[398/502] Linking C executable
FAILED: /home/ubuntu/ws/src/_build_vimon/wp76xx/app/beconn/obj/beconn/beconn 
/home/ubuntu/ws/leaf-data/dev/wp76-toolchain/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-gcc --sysroot=/home/ubuntu/ws/leaf-data/dev/wp76-toolchain/sysroots/armv7a-neon-poky-linux-gnueabi -fPIE -pie -o /home/ubuntu/ws/src/_build_vimon/wp76xx/app/beconn/obj/beconn/beconn /home/ubuntu/ws/src/_build_vimon/wp76xx/app/beconn/obj/beconn/_main.c.o -rdynamic -Wl,--enable-new-dtags,-rpath="\$ORIGIN/../lib" -L "-L/home/ubuntu/ws/src/_build_vimon/wp76xx/component/d9ef2579a6f714e76e59aea260d66b2f/obj" -lComponent_beconnComp "-L/home/ubuntu/ws/src/_build_vimon/wp76xx/component/d9ef2579a6f714e76e59aea260d66b2f/obj" -lComponent_beconnComp "-L$LEGATO_BUILD/framework/lib" -llegato -lpthread -lrt -ldl -lm 
/home/ubuntu/ws/src/_build_vimon/wp76xx/component/d9ef2579a6f714e76e59aea260d66b2f/obj/libComponent_beconnComp.so: undefined reference to `le_cfg_QuickSetString'
/home/ubuntu/ws/src/_build_vimon/wp76xx/component/d9ef2579a6f714e76e59aea260d66b2f/obj/libComponent_beconnComp.so: undefined reference to `le_cfg_QuickSetEmpty'
/home/ubuntu/ws/src/_build_vimon/wp76xx/component/d9ef2579a6f714e76e59aea260d66b2f/obj/libComponent_beconnComp.so: undefined reference to `le_cfg_SetEmpty'
/home/ubuntu/ws/src/_build_vimon/wp76xx/component/d9ef2579a6f714e76e59aea260d66b2f/obj/libComponent_beconnComp.so: undefined reference to `le_cfg_CreateWriteTxn'
/home/ubuntu/ws/src/_build_vimon/wp76xx/component/d9ef2579a6f714e76e59aea260d66b2f/obj/libComponent_beconnComp.so: undefined reference to `le_cfg_RemoveChangeHandler'
/home/ubuntu/ws/src/_build_vimon/wp76xx/component/d9ef2579a6f714e76e59aea260d66b2f/obj/libComponent_beconnComp.so: undefined reference to `le_cfg_QuickGetInt'
/home/ubuntu/ws/src/_build_vimon/wp76xx/component/d9ef2579a6f714e76e59aea260d66b2f/obj/libComponent_beconnComp.so: undefined reference to `le_cfg_GetFloat'
/home/ubuntu/ws/src/_build_vimon/wp76xx/component/d9ef2579a6f714e76e59aea260d66b2f/obj/libComponent_beconnComp.so: undefined reference to `le_cfg_QuickSetInt'
/home/ubuntu/ws/src/_build_vimon/wp76xx/component/d9ef2579a6f714e76e59aea260d66b2f/obj/libComponent_beconnComp.so: undefined reference to `le_cfg_GetBinary'
/home/ubuntu/ws/src/_build_vimon/wp76xx/component/d9ef2579a6f714e76e59aea260d66b2f/obj/libComponent_beconnComp.so: undefined reference to `le_cfg_QuickGetString'
/home/ubuntu/ws/src/_build_vimon/wp76xx/component/d9ef2579a6f714e76e59aea260d66b2f/obj/libComponent_beconnComp.so: undefined reference to `le_cfg_GetPath'
/home/ubuntu/ws/src/_build_vimon/wp76xx/component/d9ef2579a6f714e76e59aea260d66b2f/obj/libComponent_beconnComp.so: undefined reference to `le_cfg_GetBool'
/home/ubuntu/ws/src/_build_vimon/wp76xx/component/d9ef2579a6f714e76e59aea260d66b2f/obj/libComponent_beconnComp.so: undefined reference to `le_cfg_GoToNode'
/home/ubuntu/ws/src/_build_vimon/wp76xx/component/d9ef2579a6f714e76e59aea260d66b2f/obj/libComponent_beconnComp.so: undefined reference to `le_cfg_CreateReadTxn'
/home/ubuntu/ws/src/_build_vimon/wp76xx/component/d9ef2579a6f714e76e59aea260d66b2f/obj/libComponent_beconnComp.so: undefined reference to `le_cfg_QuickSetFloat'
/home/ubuntu/ws/src/_build_vimon/wp76xx/component/d9ef2579a6f714e76e59aea260d66b2f/obj/libComponent_beconnComp.so: undefined reference to `le_cfg_QuickGetBool'
/home/ubuntu/ws/src/_build_vimon/wp76xx/component/d9ef2579a6f714e76e59aea260d66b2f/obj/libComponent_beconnComp.so: undefined reference to `le_cfg_CommitTxn'
/home/ubuntu/ws/src/_build_vimon/wp76xx/component/d9ef2579a6f714e76e59aea260d66b2f/obj/libComponent_beconnComp.so: undefined reference to `le_cfg_SetFloat'
/home/ubuntu/ws/src/_build_vimon/wp76xx/component/d9ef2579a6f714e76e59aea260d66b2f/obj/libComponent_beconnComp.so: undefined reference to `le_cfg_DeleteNode'
/home/ubuntu/ws/src/_build_vimon/wp76xx/component/d9ef2579a6f714e76e59aea260d66b2f/obj/libComponent_beconnComp.so: undefined reference to `le_cfg_SetString'
/home/ubuntu/ws/src/_build_vimon/wp76xx/component/d9ef2579a6f714e76e59aea260d66b2f/obj/libComponent_beconnComp.so: undefined reference to `le_cfg_CancelTxn'
/home/ubuntu/ws/src/_build_vimon/wp76xx/component/d9ef2579a6f714e76e59aea260d66b2f/obj/libComponent_beconnComp.so: undefined reference to `le_cfg_QuickGetFloat'
/home/ubuntu/ws/src/_build_vimon/wp76xx/component/d9ef2579a6f714e76e59aea260d66b2f/obj/libComponent_beconnComp.so: undefined reference to `le_cfg_QuickSetBinary'
/home/ubuntu/ws/src/_build_vimon/wp76xx/component/d9ef2579a6f714e76e59aea260d66b2f/obj/libComponent_beconnComp.so: undefined reference to `le_cfg_GetNodeType'
/home/ubuntu/ws/src/_build_vimon/wp76xx/component/d9ef2579a6f714e76e59aea260d66b2f/obj/libComponent_beconnComp.so: undefined reference to `le_cfg_IsEmpty'
/home/ubuntu/ws/src/_build_vimon/wp76xx/component/d9ef2579a6f714e76e59aea260d66b2f/obj/libComponent_beconnComp.so: undefined reference to `le_cfg_SetBool'
/home/ubuntu/ws/src/_build_vimon/wp76xx/component/d9ef2579a6f714e76e59aea260d66b2f/obj/libComponent_beconnComp.so: undefined reference to `le_cfg_QuickGetBinary'
/home/ubuntu/ws/src/_build_vimon/wp76xx/component/d9ef2579a6f714e76e59aea260d66b2f/obj/libComponent_beconnComp.so: undefined reference to `le_cfg_GetNodeName'
/home/ubuntu/ws/src/_build_vimon/wp76xx/component/d9ef2579a6f714e76e59aea260d66b2f/obj/libComponent_beconnComp.so: undefined reference to `le_cfg_QuickDeleteNode'
/home/ubuntu/ws/src/_build_vimon/wp76xx/component/d9ef2579a6f714e76e59aea260d66b2f/obj/libComponent_beconnComp.so: undefined reference to `le_cfg_SetInt'
/home/ubuntu/ws/src/_build_vimon/wp76xx/component/d9ef2579a6f714e76e59aea260d66b2f/obj/libComponent_beconnComp.so: undefined reference to `le_cfg_QuickSetBool'
/home/ubuntu/ws/src/_build_vimon/wp76xx/component/d9ef2579a6f714e76e59aea260d66b2f/obj/libComponent_beconnComp.so: undefined reference to `le_cfg_GetInt'
/home/ubuntu/ws/src/_build_vimon/wp76xx/component/d9ef2579a6f714e76e59aea260d66b2f/obj/libComponent_beconnComp.so: undefined reference to `le_cfg_GoToNextSibling'
/home/ubuntu/ws/src/_build_vimon/wp76xx/component/d9ef2579a6f714e76e59aea260d66b2f/obj/libComponent_beconnComp.so: undefined reference to `le_cfg_SetBinary'
/home/ubuntu/ws/src/_build_vimon/wp76xx/component/d9ef2579a6f714e76e59aea260d66b2f/obj/libComponent_beconnComp.so: undefined reference to `le_cfg_GoToFirstChild'
/home/ubuntu/ws/src/_build_vimon/wp76xx/component/d9ef2579a6f714e76e59aea260d66b2f/obj/libComponent_beconnComp.so: undefined reference to `le_cfg_GetString'
/home/ubuntu/ws/src/_build_vimon/wp76xx/component/d9ef2579a6f714e76e59aea260d66b2f/obj/libComponent_beconnComp.so: undefined reference to `le_cfg_NodeExists'
/home/ubuntu/ws/src/_build_vimon/wp76xx/component/d9ef2579a6f714e76e59aea260d66b2f/obj/libComponent_beconnComp.so: undefined reference to `le_cfg_GoToParent'
/home/ubuntu/ws/src/_build_vimon/wp76xx/component/d9ef2579a6f714e76e59aea260d66b2f/obj/libComponent_beconnComp.so: undefined reference to `le_cfg_AddChangeHandler'
```

beconn.cpp (short version)

```auto
#include "beconn.h"
#include "common-types.h"
#include "interfaces.h"
#include "legato.h"
#include "string"

string BeConn::ReadUrl(){

	string path="/beconn/url";
	string stringDefault="Error Reading Url";
	char* buffer=new char[LE_CFG_STR_LEN_BYTES];
	typedef struct le_cfg_Iterator* IteratorRef;
	IteratorRef tree = le_cfg_CreateReadTxn(path.c_str());
	le_result_t res=le_cfg_GetString(tree, path.c_str(),buffer,LE_CFG_STR_LEN_BYTES, stringDefault.c_str());
	LE_ERROR_IF(res!=LE_OK,"error reading url from config tree");	

	return "";
}

```

beconn.adef

```auto
sandboxed: false

executables:
{
    beconn = ( beconnComp )
}

processes:
{
    run:
    {
        ( beconn )
    }
}

extern:
{
    beconn = beconn.beconnComp.beconn
}
requires:
{
    configTree:
    {
        [r] . // read/write access to 
    }
    
}

```

beconn.cdef

```auto
provides:

{

api:

{

beconn = $CURDIR/../beconn.api

le_cfg.api

}

}

sources:

{

beconn.cpp

}

cxxflags:

{

-std=c++0x

-I$CURDIR/../../include

}

```

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/jyijyi/32/822_2.png) [@jyijyi](https://forum.legato.io/u/jyijyi)\
**Post date:** [August 19, 2021, 3:35pm UTC](https://forum.legato.io/t/legato-config-tree-undefined-reference-to-le-cfg/5937/2 "2021-08-19T15:35:20Z")

</div>

Cannot see the full compilation error …  
Also please post the full project here

---

<div class="post-metadata">

**Author:** ![david.geffers](https://avatars.discourse-cdn.com/v4/letter/d/65b543/32.png) [@david.geffers](https://forum.legato.io/u/david.geffers)\
**Post date:** [August 19, 2021, 3:37pm UTC](https://forum.legato.io/t/legato-config-tree-undefined-reference-to-le-cfg/5937/3 "2021-08-19T15:37:47Z")

</div>

here is the full log  
[out.txt](https://forum.legato.io/uploads/short-url/5a2dW2mAnxOgNfg6yHh8hbDcfih.txt) (81.6 KB)

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/jyijyi/32/822_2.png) [@jyijyi](https://forum.legato.io/u/jyijyi)\
**Post date:** [August 20, 2021, 1:31am UTC](https://forum.legato.io/t/legato-config-tree-undefined-reference-to-le-cfg/5937/4 "2021-08-20T01:31:34Z")

</div>

You can refer to following sample to use config tree:

> <https://github.com/legatoproject/legato-af/blob/master/apps/sample/eCallDemo/eCallAppComponent/eCallApp.c>

> **[legato-af/apps/test/framework/configTree at master · legatoproject/legato-af](https://github.com/legatoproject/legato-af/tree/master/apps/test/framework/configTree)**
>
> master/apps/test/framework/configTree

---

<div class="post-metadata">

**Author:** ![david.geffers](https://avatars.discourse-cdn.com/v4/letter/d/65b543/32.png) [@david.geffers](https://forum.legato.io/u/david.geffers)\
**Post date:** [August 24, 2021, 1:24pm UTC](https://forum.legato.io/t/legato-config-tree-undefined-reference-to-le-cfg/5937/5 "2021-08-24T13:24:37Z")

</div>

sample is known, still not resolved

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/jyijyi/32/822_2.png) [@jyijyi](https://forum.legato.io/u/jyijyi)\
**Post date:** [August 24, 2021, 1:45pm UTC](https://forum.legato.io/t/legato-config-tree-undefined-reference-to-le-cfg/5937/6 "2021-08-24T13:45:58Z")

</div>

then can you compile the sample eCallDemo?

If you can compile, that means your application has problem.

FYI, I can compile the eCallDemo application with WP76 R13 package.
