# How compile with LibXml?

**URL:** <https://mangoh.discourse.group/t/how-compile-with-libxml/2786>\
**Category:** mangOH Red\
**Created:** [July 18, 2019, 2:52pm UTC](https://mangoh.discourse.group/t/how-compile-with-libxml/2786 "2019-07-18T14:52:38Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![flonflon](https://avatars.discourse-cdn.com/v4/letter/f/278dde/32.png) [@flonflon](https://mangoh.discourse.group/u/flonflon)\
**Post date:** [July 18, 2019, 2:52pm UTC](https://mangoh.discourse.group/t/how-compile-with-libxml/2786/1 "2019-07-18T14:52:39Z")

</div>

Hey everybody,

Someones have already used libxml ?

With the command ldprog -p we can know that libxml is installed about device.

But I can’t compile a project due to an error of “cross compilation”.

I would be grateful if someone have an example or an explanation how use libxml on legato.

Best Regards,

---

<div class="post-metadata">

**Author:** ![dfrey](https://sea2.discourse-cdn.com/flex016/user_avatar/mangoh.discourse.group/dfrey/32/303_2.png) [@dfrey](https://mangoh.discourse.group/u/dfrey)\
**Post date:** [September 18, 2019, 9:47pm UTC](https://mangoh.discourse.group/t/how-compile-with-libxml/2786/2 "2019-09-18T21:47:17Z")

</div>

Did you see this: [https://docs.legato.io/latest/defFilesCdef.html#defFilesCdef\_requiresLib](https://docs.legato.io/latest/defFilesCdef.html#defFilesCdef_requiresLib)

It looks like you need to put this in your `Component.cdef`:

```nohighlight
requires:
{
    lib:
    {
        xml
    }
}

```

---

<div class="post-metadata">

**Author:** ![kalaivani](https://sea2.discourse-cdn.com/flex016/user_avatar/mangoh.discourse.group/kalaivani/32/2183_2.png) [@kalaivani](https://mangoh.discourse.group/u/kalaivani)\
**Post date:** [March 1, 2022, 9:25am UTC](https://mangoh.discourse.group/t/how-compile-with-libxml/2786/3 "2022-03-01T09:25:29Z")

</div>

Hi any sample available to read a XML file

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea2.discourse-cdn.com/flex016/user_avatar/mangoh.discourse.group/jyijyi/32/997_2.png) [@jyijyi](https://mangoh.discourse.group/u/jyijyi)\
**Post date:** [March 1, 2022, 9:33am UTC](https://mangoh.discourse.group/t/how-compile-with-libxml/2786/4 "2022-03-01T09:33:27Z")

</div>

you can see here:

> **[Problems with using libxml2](https://forum.legato.io/t/problems-with-using-libxml2/5521/5)**
>
> The Forum won’t let me Upload files so: xmlTest.c : // Include the core framework C APIs. #include “legato.h” // Include your component’s API interfaces. #include “interfaces.h” #include #include // This function is called only once on...
