tinyxml2 is a c++ xml parser, its webpage: https://github.com/leethomason/tinyxml2.
More xml parser in c++: What XML parser should I use in C++? [closed].
First clone it from github, and then:
mkdir build && cd build
cmake ..
make -j8
sudo make install
First set LD_LIBRARY_PATH
:
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
In xxx.cpp
:
#include <tinyxml2.h>
//include other headers...
using namespace tinyxml2;
//main program here...
Compile and run it with:
g++ xxx.cpp -ltinyxml2
./a.out