How to use tinyxml2 for Geant4 project

Please fill out the following information to help in answering your question, and also see tips for posting code snippets. If you don’t provide this information it will take more time to help with your problem!

Geant4 Version: 11.2
Operating System: Window 11
Compiler/Version:
CMake Version:

Dear all,
I want to handle XML files in the Geant4 project. I found some information on the internet that the tinyxml2 can help me to resolve this requirement.
I don’t know how to import it into my project for use purposes. How can I link it with my project?
Can anyone help me? I appreciate any help you can provide.

Best regards,
Bui Tien Hung


Tinyxml is fully documented on its GitHub site:

see in particular: GitHub - leethomason/tinyxml2: TinyXML2 is a simple, small, efficient, C++ XML parser that can be easily integrated into other programs.

It should just be a case of obtaining and the mentioned tinyxml2.h/cpp file and adding them to the list of files in your build.