# XML parsing for I/O

**URL:** <https://root-forum.cern.ch/t/xml-parsing-for-i-o/41514>\
**Category:** Newbie\
**Tags:** io\
**Created:** [September 20, 2020, 4:42pm UTC](https://root-forum.cern.ch/t/xml-parsing-for-i-o/41514 "2020-09-20T16:42:16Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Andrea\_Falzetti](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/andrea_falzetti/32/22128_2.png) [@Andrea\_Falzetti](https://root-forum.cern.ch/u/Andrea_Falzetti)\
**Post date:** [September 20, 2020, 4:42pm UTC](https://root-forum.cern.ch/t/xml-parsing-for-i-o/41514/1 "2020-09-20T16:42:16Z")

</div>

Hi,  
First of all i apologize in advance if this question wastes anybody’s time but i am a total newbie.  
I need to parse an XML file and i am having issues using the TXMLEngine class in order to do that.

I am trying to use the code in this example ([https://root.cern/doc/master/xmlreadfile\_8C.html](https://root.cern/doc/master/xmlreadfile_8C.html)), but in compilation it gives the following errors:

```auto
/usr/bin/ld: /tmp/ccJiwqVU.o: in function `DisplayNode(TXMLEngine&, void*, int)':
main.cpp:(.text+0x170): undefined reference to `TXMLEngine::GetNodeName(void*)'
/usr/bin/ld: main.cpp:(.text+0x1a4): undefined reference to `TXMLEngine::GetNS(void*)'
/usr/bin/ld: main.cpp:(.text+0x1c2): undefined reference to `TXMLEngine::GetNSReference(void*)'
/usr/bin/ld: main.cpp:(.text+0x1d8): undefined reference to `TXMLEngine::GetNSName(void*)'
/usr/bin/ld: main.cpp:(.text+0x212): undefined reference to `TXMLEngine::GetFirstAttr(void*)'
/usr/bin/ld: main.cpp:(.text+0x230): undefined reference to `TXMLEngine::GetAttrValue(void*)'
/usr/bin/ld: main.cpp:(.text+0x246): undefined reference to `TXMLEngine::GetAttrName(void*)'
/usr/bin/ld: main.cpp:(.text+0x280): undefined reference to `TXMLEngine::GetNextAttr(void*)'
/usr/bin/ld: main.cpp:(.text+0x299): undefined reference to `TXMLEngine::GetNodeContent(void*)'
/usr/bin/ld: main.cpp:(.text+0x2df): undefined reference to `TXMLEngine::GetChild(void*, bool)'
/usr/bin/ld: main.cpp:(.text+0x31b): undefined reference to `TXMLEngine::GetNext(void*, bool)'
/usr/bin/ld: /tmp/ccJiwqVU.o: in function `xmlreadfile(char const*)':
main.cpp:(.text+0x355): undefined reference to `TXMLEngine::TXMLEngine()'
/usr/bin/ld: main.cpp:(.text+0x36d): undefined reference to `TXMLEngine::ParseFile(char const*, int)'
/usr/bin/ld: main.cpp:(.text+0x392): undefined reference to `TXMLEngine::DocGetRootElement(void*)'
/usr/bin/ld: main.cpp:(.text+0x3c1): undefined reference to `TXMLEngine::FreeDoc(void*)'
/usr/bin/ld: main.cpp:(.text+0x3d2): undefined reference to `TXMLEngine::~TXMLEngine()'
/usr/bin/ld: main.cpp:(.text+0x3f9): undefined reference to `TXMLEngine::~TXMLEngine()'
collect2: error: ld returned 1 exit status

```

The errors seem to tell that i am using the class `TXMLEngine` without having it included, but i did `#include "TXMLEngine.h"` so I should be able to use the class in my code.

* * *

_Please read [tips for efficient and successful posting](https://root-forum.cern.ch/t/tips-for-efficient-and-successful-posting/28292) and [posting code](https://root-forum.cern.ch/t/posting-code-read-this-first/28293)_

_ROOT Version:_ 6.22  
_Platform:_ Ubuntu  
_Compiler:_ g++

---

<div class="post-metadata">

**Author:** ![Michael\_Kelsey](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/michael_kelsey/32/16014_2.png) [@Michael\_Kelsey](https://root-forum.cern.ch/u/Michael_Kelsey)\
**Post date:** [September 20, 2020, 8:02pm UTC](https://root-forum.cern.ch/t/xml-parsing-for-i-o/41514/2 "2020-09-20T20:02:09Z")

</div>

Those are errors when linking the executable (that’s what `/usr/bin/ld` does). You did the correct thing with the `#include` in your source code. When linking your exeutable, you need to specify the library which contains the XML support, namely `-lXMLIO`.
