Compile libxml program
For XML programming in C, you can make use of certain libraries like libxml. To compile a libxml program, you must be aware of the libraries and their installation. xml2-config comes in bundled with libxml. With xml2-config, you can find out the various values needed to compile the libxml programs.
After installing libxml, you must check the path where the libxml header files are present
$ xml2-config --cflags -I/usr/include/libxml2
To find the options for linking,
$ xml2-config --libs -lxml2
Now you know both these values, you can compile your program containing libXML headers and functions in the following manner
$ gcc file.c `xml2-config --cflags --libs`
or in the following manner, using the values obtained before.
$ gcc file.c -lxml2 -I/usr/include/libxml2
Comments: